Renorm
Source:R/gen-namespace-docs.R
, R/gen-namespace-examples.R
, R/gen-namespace.R
torch_renorm.Rd
Renorm
renorm(input, p, dim, maxnorm, out=NULL) -> Tensor
Returns a tensor where each sub-tensor of input
along dimension
dim
is normalized such that the p
-norm of the sub-tensor is lower
than the value maxnorm
Examples
if (torch_is_installed()) {
x = torch_ones(c(3, 3))
x[2,]$fill_(2)
x[3,]$fill_(3)
x
torch_renorm(x, 1, 1, 5)
}
#> torch_tensor
#> 1.0000 1.0000 1.0000
#> 1.6667 1.6667 1.6667
#> 1.6667 1.6667 1.6667
#> [ CPUFloatType{3,3} ]