@Namespace(value="tensorflow::ops") @NoOffset @Properties(inherit=tensorflow.class) public class MatrixTriangularSolve extends Pointer
matrix
is a tensor of shape [..., M, M]
whose inner-most 2 dimensions form
square matrices. If lower
is True
then the strictly upper triangular part
of each inner-most matrix is assumed to be zero and not accessed.
If lower
is False then the strictly lower triangular part of each inner-most
matrix is assumed to be zero and not accessed.
rhs
is a tensor of shape [..., M, K]
.
The output is a tensor of shape [..., M, K]
. If adjoint
is
True
then the innermost matrices in output
satisfy matrix equations
matrix[..., :, :] * output[..., :, :] = rhs[..., :, :]
.
If adjoint
is False
then the strictly then the innermost matrices in
output
satisfy matrix equations
adjoint(matrix[..., i, k]) * output[..., k, j] = rhs[..., i, j]
.
Example:
python
a = tf.constant([[3, 0, 0, 0],
[2, 1, 0, 0],
[1, 0, 1, 0],
[1, 1, 1, 1]], dtype=tf.float32)
b = tf.constant([[4],
[2],
[4],
[2]], dtype=tf.float32)
x = tf.linalg.triangular_solve(a, b, lower=True)
x
# <tf.Tensor: id=257, shape=(4, 1), dtype=float32, numpy=
# array([[ 1.3333334 ],
# [-0.66666675],
# [ 2.6666665 ],
# [-1.3333331 ]], dtype=float32)>
# in python3 one can use `a@x`
tf.matmul(a, x)
# <tf.Tensor: id=263, shape=(4, 1), dtype=float32, numpy=
# array([[4. ],
# [2. ],
# [4. ],
# [1.9999999]], dtype=float32)>
Arguments:
* scope: A Scope object
* matrix: Shape is [..., M, M]
.
* rhs: Shape is [..., M, K]
.
Optional attributes (see Attrs
):
* lower: Boolean indicating whether the innermost matrices in matrix
are
lower or upper triangular.
* adjoint: Boolean indicating whether to solve with matrix
or its (block-wise)
adjoint.
\compatibility(numpy)
Equivalent to scipy.linalg.solve_triangular
\end_compatibility
Returns:
* Output
: Shape is [..., M, K]
.Modifier and Type | Class and Description |
---|---|
static class |
MatrixTriangularSolve.Attrs
Optional attribute setters for MatrixTriangularSolve
|
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Constructor and Description |
---|
MatrixTriangularSolve(Pointer p)
Pointer cast constructor.
|
MatrixTriangularSolve(Scope scope,
Input matrix,
Input rhs) |
MatrixTriangularSolve(Scope scope,
Input matrix,
Input rhs,
MatrixTriangularSolve.Attrs attrs) |
Modifier and Type | Method and Description |
---|---|
static MatrixTriangularSolve.Attrs |
Adjoint(boolean x) |
Input |
asInput() |
Output |
asOutput() |
static MatrixTriangularSolve.Attrs |
Lower(boolean x) |
Node |
node() |
Operation |
operation() |
MatrixTriangularSolve |
operation(Operation setter) |
Output |
output() |
MatrixTriangularSolve |
output(Output 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 MatrixTriangularSolve(Pointer p)
Pointer(Pointer)
.public MatrixTriangularSolve(@Const @ByRef Scope scope, @ByVal Input matrix, @ByVal Input rhs)
public Node node()
@ByVal public static MatrixTriangularSolve.Attrs Lower(@Cast(value="bool") boolean x)
@ByVal public static MatrixTriangularSolve.Attrs Adjoint(@Cast(value="bool") boolean x)
public MatrixTriangularSolve operation(Operation setter)
public MatrixTriangularSolve output(Output setter)
Copyright © 2022. All rights reserved.