tf.svd(tensor, compute_uv=True, full_matrices=False, name=None)
Computes the singular value decompositions of one or more matrices.
Computes the SVD of each inner matrix in tensor such that tensor[..., :, :] = u[..., :, :] * diag(s[..., :, :]) * transpose(v[..., :,
:])
# a is a tensor. # s is a tensor of singular values. # u is a tensor of left singular vectors. # v is a tensor of right singular vectors. s, u, v = svd(a) s = svd(a, compute_uv=False)
Args:
- 
matrix:Tensorof shape[..., M, N]. LetPbe the minimum ofMandN. - 
compute_uv: IfTruethen left and right singular vectors will be computed and returned inuandv, respectively. Otherwise, only the singular values will be computed, which can be significantly faster. - 
full_matrices: If true, compute full-sizeduandv. If false (the default), compute only the leadingPsingular vectors. Ignored ifcompute_uvisFalse. - 
name: string, optional name of the operation. 
Returns:
- 
s: Singular values. Shape is[..., P]. - 
u: Right singular vectors. Iffull_matricesisFalse(default) then shape is[..., M, P]; iffull_matricesisTruethen shape is[..., M, M]. Not returned ifcompute_uvisFalse. - 
v: Left singular vectors. Iffull_matricesisFalse(default) then shape is[..., N, P]. Iffull_matricesisTruethen shape is[..., N, N]. Not returned ifcompute_uvisFalse. 
Please login to continue.