Slogdet
Source:R/gen-namespace-docs.R
, R/gen-namespace-examples.R
, R/gen-namespace.R
torch_slogdet.Rd
Slogdet
Arguments
- self
(Tensor) the input tensor of size
(*, n, n)
where*
is zero or more batch dimensions.
Note
`input` has zero determinant, this returns `(0, -inf)`. If
`slogdet` internally uses SVD results when `input`
Backward through `slogdet`
is not invertible. In this case, double backward through in when `input` doesn't have distinct singular values.
will be unstable See `~torch.svd` for details.
slogdet(input) -> (Tensor, Tensor)
Calculates the sign and log absolute value of the determinant(s) of a square matrix or batches of square matrices.
Examples
if (torch_is_installed()) {
A = torch_randn(c(3, 3))
A
torch_det(A)
torch_logdet(A)
torch_slogdet(A)
}
#> [[1]]
#> torch_tensor
#> 1
#> [ CPUFloatType{} ]
#>
#> [[2]]
#> torch_tensor
#> -0.508016
#> [ CPUFloatType{} ]
#>