@Namespace(value="tensorflow::ops") @NoOffset @Properties(inherit=tensorflow.class) public class MatrixBandPart extends Pointer
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, k, ..., m, n]
.
The indicator function
in_band(m, n) = (num_lower < 0 || (m-n) <= num_lower)) &&
(num_upper < 0 || (n-m) <= num_upper)
.
For example:
# if 'input' is [[ 0, 1, 2, 3]
[-1, 0, 1, 2]
[-2, -1, 0, 1]
[-3, -2, -1, 0]],
tf.matrix_band_part(input, 1, -1) ==> [[ 0, 1, 2, 3]
[-1, 0, 1, 2]
[ 0, -1, 0, 1]
[ 0, 0, -1, 0]],
tf.matrix_band_part(input, 2, 1) ==> [[ 0, 1, 0, 0]
[-1, 0, 1, 0]
[-2, -1, 0, 1]
[ 0, -2, -1, 0]]
Useful special cases:
tf.matrix_band_part(input, 0, -1) ==> Upper triangular part.
tf.matrix_band_part(input, -1, 0) ==> Lower triangular part.
tf.matrix_band_part(input, 0, 0) ==> Diagonal.
Arguments:
* scope: A Scope object
* input: Rank k
tensor.
* num_lower: 0-D tensor. Number of subdiagonals to keep. If negative, keep entire
lower triangle.
* num_upper: 0-D tensor. Number of superdiagonals to keep. If negative, keep
entire upper triangle.
Returns:
* Output
: Rank k
tensor of the same shape as input. The extracted banded tensor.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
MatrixBandPart(Pointer p)
Pointer cast constructor.
|
MatrixBandPart(Scope scope,
Input input,
Input num_lower,
Input num_upper) |
Modifier and Type | Method and Description |
---|---|
Input |
asInput() |
Output |
asOutput() |
Output |
band() |
MatrixBandPart |
band(Output setter) |
Node |
node() |
Operation |
operation() |
MatrixBandPart |
operation(Operation setter) |
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public MatrixBandPart(Pointer p)
Pointer(Pointer)
.public Node node()
public MatrixBandPart operation(Operation setter)
public MatrixBandPart band(Output setter)
Copyright © 2022. All rights reserved.