megengine.module.init.uniform_#

uniform_(tensor, a=0.0, b=1.0)[source]#

Fills the given tensor with random value sampled from uniform distribution \(\mathcal{U}(\text{a}, \text{b})\).

Parameters:
  • tensor (Tensor) – tensor to be initialized.

  • a (float) – lower bound of the sampling interval.

  • b (float) – upper bound of the sampling interval.

Return type:

None