r"""Fills the given ``tensor`` with random value sampled from normal distribution :math:`\mathcal{N}(\text{mean}, \text{std}^2)`. Args: tensor: tensor to be initialized. mean: mean of the normal distribution. std: standard deviation of the normal distribution.
(tensor: Tensor, mean: float = 0.0, std: float = 1.0)
| 51 | |
| 52 | |
| 53 | def normal_(tensor: Tensor, mean: float = 0.0, std: float = 1.0) -> None: |
| 54 | r"""Fills the given ``tensor`` with random value sampled from normal distribution |
| 55 | :math:`\mathcal{N}(\text{mean}, \text{std}^2)`. |
| 56 | |
| 57 | Args: |
| 58 | tensor: tensor to be initialized. |
| 59 | mean: mean of the normal distribution. |
| 60 | std: standard deviation of the normal distribution. |
| 61 | """ |
| 62 | tensor._reset(normal(size=tensor.shape, mean=mean, std=std).astype(tensor.dtype)) |
| 63 | |
| 64 | |
| 65 | def calculate_gain( |
no test coverage detected