T
- data type for s()
output@Operator(group="linalg") public final class Svd<T> extends PrimitiveOp
Computes the SVD of each inner matrix in `input` such that `input[..., :, :] = u[..., :, :] * diag(s[..., :, :]) * transpose(v[..., :, :])`
# a is a tensor containing a batch of matrices.
# s is a tensor of singular values for each matrix.
# u is the tensor containing the left singular vectors for each matrix.
# v is the tensor containing the right singular vectors for each matrix.
s, u, v = svd(a)
s, _, _ = svd(a, compute_uv=False)
Modifier and Type | Class and Description |
---|---|
static class |
Svd.Options
Optional attributes for
Svd |
operation
Modifier and Type | Method and Description |
---|---|
static Svd.Options |
computeUv(Boolean computeUv) |
static <T> Svd<T> |
create(Scope scope,
Operand<T> input,
Svd.Options... options)
Factory method to create a class wrapping a new Svd operation.
|
static Svd.Options |
fullMatrices(Boolean fullMatrices) |
Output<T> |
s()
Singular values.
|
Output<T> |
u()
Left singular vectors.
|
Output<T> |
v()
Left singular vectors.
|
equals, hashCode, op, toString
public static <T> Svd<T> create(Scope scope, Operand<T> input, Svd.Options... options)
scope
- current scopeinput
- A tensor of shape `[..., M, N]` whose inner-most 2 dimensions
form matrices of size `[M, N]`. Let `P` be the minimum of `M` and `N`.options
- carries optional attributes valuespublic static Svd.Options computeUv(Boolean computeUv)
computeUv
- If true, left and right singular vectors will be
computed and returned in `u` and `v`, respectively.
If false, `u` and `v` are not set and should never referenced.public static Svd.Options fullMatrices(Boolean fullMatrices)
fullMatrices
- If true, compute full-sized `u` and `v`. If false
(the default), compute only the leading `P` singular vectors.
Ignored if `compute_uv` is `False`.public Output<T> u()
Copyright © 2022. All rights reserved.