Returns a random permutation of integers from 0 to n - 1.
tch_randperm(n, dtype = NULL, layout = NULL, device = NULL, requires_grad = FALSE)
n | the upper bound (exclusive). |
---|---|
dtype | the desired data type of returned tensor. Default: if |
device | the desired device of returned tensor. Default: if |
requires_grad | If autograd should record operations on the
returned tensor. Default: |
the | desired layout of returned Tensor. Default: 'strided' |
The shape of the tensor is defined by the variable argument sizes.
tch_randperm(4)#> tensor #> 0 #> 1 #> 2 #> 3 #> [ Variable[CPUFloatType]{4} ]