glorot_normal

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

Return a tensor initialized from the glorot normal distribution.

The GlorotNormal distribution is defined as:

\[X \sim N(0, \sqrt{\frac{scale}{\text{FAN}}}) \]
Parameters:
  • shape (Sequence[Union[int, dragon.Tensor]]) – The shape of the tensor.
  • scale (number, optional, default=2) – The scale factor of distribution.
  • mode ({'FAN_IN', 'FAN_OUT', 'FAN_AVG'}, optional) – The mode to compute the normalizer.
  • dtype (str, optional, default='float32') – The optional data type.
Returns:

dragon.Tensor – The output tensor.