Fills the given ``tensor`` with value ``val``. Args: tensor: tensor to be initialized. val: value to be filled throughout the tensor.
(tensor: Tensor, val: Union[float, int])
| 11 | |
| 12 | |
| 13 | def fill_(tensor: Tensor, val: Union[float, int]) -> None: |
| 14 | """Fills the given ``tensor`` with value ``val``. |
| 15 | |
| 16 | Args: |
| 17 | tensor: tensor to be initialized. |
| 18 | val: value to be filled throughout the tensor. |
| 19 | """ |
| 20 | tensor._reset(full(shape=tensor.shape, value=val, dtype=tensor.dtype)) |
| 21 | |
| 22 | |
| 23 | def zeros_(tensor: Tensor) -> None: |