Reference from TensorFlow: https://www.tensorflow.org/api_docs/cc/class/tensorflow/ops/matrix-band-part
This op is used by the Music Transformer model.
Is this issue taken?
If not I can get an implementation ready by tomorrow hopefully!
@Kriyszig Fantastic! It's all yours :)
PR#1520 from January already implemented tf.linalg.bandPart. It is purely based on existing tfjs operations and, according to some quick and dirty benchmarks, it is around 10 times slower than a backend-based implementation, which should be acceptable for an O(m*n) operation. I've taken the liberty to add PR#2155 to the benchmark here. PR#2155 currently seems to have some performance issues caused by the way that concat is used.
@DirkToewe, Can you port PR#1520 to this monorepo? Your implementation scales really well unlike mine.
Okay, will do as soon as I can.
Done! You can find the PR here. @Kriyszig Your PR had better documentation and more tests so I've based my PR on it. If that's okay with You, You just need to to give Your consent in the PR.
Seems like this can be closed now, thanks to #2226?
Most helpful comment
Okay, will do as soon as I can.