uniform

dragon.random.uniform(
  shape,
  low=- 1,
  high=1,
  dtype='float32',
  **kwargs
)[source]

Return a tensor initialized from the uniform distribution.

\[\text{out} \sim \mathcal{U}(\alpha, \beta) \]
Parameters:
  • shape (Sequence[Union[int, dragon.Tensor]]) – The tensor shape.
  • low (number, optional, default=-1) – The value to \(\alpha\).
  • high (number, optional, default=1) – The value to \(\beta\).
  • dtype (str, optional, default='float32') – The optional data type.
Returns:

dragon.Tensor – The output tensor.