xlnstorch.nn.init.xavier_uniform_

xlnstorch.nn.init.xavier_uniform_#

xlnstorch.nn.init.xavier_uniform_(tensor, gain=1.0, generator=None)#

Fills the input tensor with values according to the Xavier uniform initialization.

Parameters:
  • tensor (LNSTensor) – The tensor to fill with values.

  • gain (float, optional) – An optional scaling factor (default is 1.0).

  • generator (torch.Generator, optional) – A random number generator to use for reproducibility (default is None).

Returns:

The input tensor filled with values from the Xavier uniform distribution.

Return type:

LNSTensor