Returns a tensor filled with random integers generated uniformly between low (inclusive) and high (exclusive).
tch_randint(low = 0, high = NULL, sizes = NULL, dtype = NULL, layout = NULL, device = NULL, requires_grad = FALSE)
low | (optional) Lowest integer to be drawn from the distribution. Default: 0. |
---|---|
sizes | a sequence of integers defining the shape of the output tensor. |
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: |
hogh | One above the highest integer to be drawn from the distribution. |
the | desired layout of returned Tensor. Default: 'strided' |
The shape of the tensor is defined by the variable argument size.
tch_randint(3, 5, 3)#> tensor #> 4 #> 4 #> 3 #> [ Variable[CPUFloatType]{3} ]#> tensor #> 5 1 #> 6 1 #> [ Variable[CPUFloatType]{2,2} ]#> tensor #> 3 3 #> 3 9 #> [ Variable[CPUFloatType]{2,2} ]