fn
randint_op
→TensorImplPtrint randint_op(const int & shape, int low, int high, Dtype dt, Device device, Generator * gen)Python wrappers
Public Python APIs implemented by this engine symbol.Allocates an integer tensor filled with samples drawn uniformly from the integer interval .
Math
\mathrm{high}-1\}$$Parameters
shapeconst Shape&Shape of the output tensor.
lowint64_tInclusive lower bound.
highint64_tExclusive upper bound; must be strictly greater than
low.dtDtypeInteger dtype (
I32, I64, U8 …).deviceDeviceMemory domain.
Bit-stream state.
Returns
TensorImplPtrNewly allocated leaf integer tensor (requires_grad = false).
Notes
The integer dtype must be wide enough to represent every value in losslessly; the underlying Storage helper does not mask or wrap on overflow.