MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / MatrixBandPart

Function MatrixBandPart

tensorflow/go/op/wrappers.go:2746–2758  ·  view source on GitHub ↗

Copy a tensor setting everything outside a central band in each innermost matrix to zero. The `band` part is computed as follows: Assume `input` has `k` dimensions `[I, J, K, ..., M, N]`, then the output is a tensor with the same shape where `band[i, j, k, ..., m, n] = in_band(m, n) * input[i, j,

(scope *Scope, input tf.Output, num_lower tf.Output, num_upper tf.Output)

Source from the content-addressed store, hash-verified

2744//
2745// Returns Rank `k` tensor of the same shape as input. The extracted banded tensor.
2746func MatrixBandPart(scope *Scope, input tf.Output, num_lower tf.Output, num_upper tf.Output) (band tf.Output) {
2747 if scope.Err() != nil {
2748 return
2749 }
2750 opspec := tf.OpSpec{
2751 Type: "MatrixBandPart",
2752 Input: []tf.Input{
2753 input, num_lower, num_upper,
2754 },
2755 }
2756 op := scope.AddOperation(opspec)
2757 return op.Output(0)
2758}
2759
2760// Returns the batched diagonal part of a batched tensor.
2761//

Callers 2

TEST_FFunction · 0.85
MatrixBandPartGradFunction · 0.85

Calls 3

ErrMethod · 0.45
AddOperationMethod · 0.45
OutputMethod · 0.45

Tested by 1

TEST_FFunction · 0.68