Skip to main content

ClikaRT::ops::random_

function

random_()

Tensor& random_(
    Tensor& self,
    std::optional<std::int64_t> low = std::nullopt,
    std::optional<std::int64_t> high = std::nullopt,
    StreamOrDevice s = {}
)

In-place uniform-INTEGER fill: overwrites self with draws from [low, high). low and high come both or neither; with both absent, the range is the dtype's full representable-integer span. A view input writes through its base storage. Returns self for chaining.

Throws

  • ClikaRT::Error: (INVALID_ARGUMENT) when exactly one bound is given (code_name() carries the reason).

Declared in ClikaRT/compute/ops.h, line 4160