Tensorflow.js tf.linalg.bandPart() Function
The tf.linalg.bandPart() function is used to calculate the band part of the given tensor.
tf.linalg.bandPart (a, numLower, numUpper)
- a: it is tf.tensor to be passed.
- numLower: Number of subdiagonals to keep. If negative, keep entire lower triangle
- numUpper: Number of subdiagonals to keep. If negative, keep entire upper triangle
Return Value: It returns tf.Tensor1D.
Tensor [[0, 1, 2, 3], [4, 0, 1, 2], [0, 1, 0, 1], [0, 0, 1, 0]]
Tensor [[0, 1, 2, 3], [4, 0, 1, 2], [3, 1, 0, 1], [3, 1, 1, 0]]