@Namespace(value="tensorflow::ops") @NoOffset @Properties(inherit=tensorflow.class) public class MatrixDiagPart extends Pointer
diagonal
part
of the batched input
. The diagonal
part is computed as follows:
Assume input
has k
dimensions [I, J, K, ..., M, N]
, then the output is a
tensor of rank k - 1
with dimensions [I, J, K, ..., min(M, N)]
where:
diagonal[i, j, k, ..., n] = input[i, j, k, ..., n, n]
.
The input must be at least a matrix.
For example:
# 'input' is [[[1, 0, 0, 0]
[0, 2, 0, 0]
[0, 0, 3, 0]
[0, 0, 0, 4]],
[[5, 0, 0, 0]
[0, 6, 0, 0]
[0, 0, 7, 0]
[0, 0, 0, 8]]]
and input.shape = (2, 4, 4)
tf.matrix_diag_part(input) ==> [[1, 2, 3, 4], [5, 6, 7, 8]]
which has shape (2, 4)
Arguments:
* scope: A Scope object
* input: Rank k
tensor where k >= 2
.
Returns:
* Output
: The extracted diagonal(s) having shape
diagonal.shape = input.shape[:-2] + [min(input.shape[-2:])]
.Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
MatrixDiagPart(Pointer p)
Pointer cast constructor.
|
MatrixDiagPart(Scope scope,
Input input) |
Modifier and Type | Method and Description |
---|---|
Input |
asInput() |
Output |
asOutput() |
Output |
diagonal() |
MatrixDiagPart |
diagonal(Output setter) |
Node |
node() |
Operation |
operation() |
MatrixDiagPart |
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 MatrixDiagPart(Pointer p)
Pointer(Pointer)
.public Node node()
public MatrixDiagPart operation(Operation setter)
public MatrixDiagPart diagonal(Output setter)
Copyright © 2022. All rights reserved.