eazygrad.uniform

eazygrad.uniform(*shape: int, low: float = 0.0, high: float = 1.0, requires_grad: bool = False, dtype: Any = numpy.float32) _Tensor[source]

Return a tensor filled with samples from a uniform distribution.

Parameters:
  • *shape (int) – Output shape.

  • low (float, default=0.0) – Lower bound of the distribution.

  • high (float, default=1.0) – Upper bound of the distribution.

  • requires_grad (bool, default=False) – Whether to track gradients for the returned tensor.

  • dtype (numpy.dtype or type, default=numpy.float32) – Output dtype.

Returns:

_Tensor – Randomly initialized tensor.

See also

torch.rand