glorot_normal

dragon.random.glorot_normal(
  shape,
  scale=2.0,
  mode='fan_in',
  dtype='float32',
  **kwargs
)[source]

Return a tensor initialized from the glorot normal distribution.

\[\text{out} \sim \mathcal{N}(0, \frac{scale}{\text{fan}}) \]
Parameters:
  • shape (Sequence[Union[int, dragon.Tensor]]) – The tensor shape.
  • mode ({'fan_in', 'fan_out', 'fan_avg'}, optional) – The mode to compute fans.
  • scale (float, optional, default=2.0) – The scale factor to distribution.
  • dtype (str, optional, default='float32') – The optional data type.
Returns:

dragon.Tensor – The output tensor.