torch_randperm {torch} | R Documentation |
Randperm
Description
Randperm
Usage
torch_randperm(
n,
dtype = torch_int64(),
layout = NULL,
device = NULL,
requires_grad = FALSE
)
Arguments
n |
(int) the upper bound (exclusive) |
dtype |
( |
layout |
( |
device |
( |
requires_grad |
(bool, optional) If autograd should record operations on the returned tensor. Default: |
randperm(n, out=NULL, dtype=torch.int64, layout=torch.strided, device=NULL, requires_grad=False) -> LongTensor
Returns a random permutation of integers from 0
to n - 1
.
Examples
if (torch_is_installed()) {
torch_randperm(4)
}
[Package torch version 0.13.0 Index]