uniform_like

dragon.random.uniform_like(
  other,
  low=-1,
  high=1,
  dtype='float32',
  **kwargs
)

Return a tensor shaping like another initialized from the uniform distribution.

The RandomUniform distribution is defined as:

\[X \sim U(\alpha, \beta) \]
Parameters:
  • other (dragon.Tensor) – The tensor to hint the shape.
  • low (number, optional, default=-1) – The value of \(\alpha\).
  • high (number, optional, default=1) – The value of \(\beta\).
  • dtype (str, optional, default='float32') – The optional data type.
Returns:

dragon.Tensor – The output tensor.