tensor.random_uniform_like
RandomUniformLike generates a tensor with random values using a uniform distribution, matching the shape of the input tensor.
This operation creates a new tensor with the same shape as the input tensor, where each element is initialized with a random value sampled from a uniform distribution.
Args
tensor
(@Tensor<T>
) - The input tensor of [N,C,H,W], where N is the batch axis, C is the channel or depth, H is the height and W is the width.high
(Option) - An optional parameter specifying the upper bound (exclusive) of the uniform distribution. If not provided, defaults to 1.0.low
(Option) - An optional parameter specifying the lower bound (inclusive) of the uniform distribution. If not provided, defaults to 0.0.seed
(Option) - An optional parameter specifying the seed for the random number generator. If not provided, a random seed will be used.
Returns
A
Tensor<T>
with the same shape as the input tensor, filled with random values from a uniform distribution within the specified range.
Examples
Last updated