Creates a tensor with the given shape, filled with random values from a uniform distribution over the interval `[-prod(shape)**-0.5, prod(shape)**-0.5)`. You can pass in `dtype` and `device` keyword arguments to control the data type and device of the tensor. Additionally, all othe
(*shape, **kwargs)
| 721 | |
| 722 | @staticmethod |
| 723 | def scaled_uniform(*shape, **kwargs) -> Tensor: |
| 724 | """ |
| 725 | Creates a tensor with the given shape, filled with random values from a uniform distribution |
| 726 | over the interval `[-prod(shape)**-0.5, prod(shape)**-0.5)`. |
| 727 | |
| 728 | You can pass in `dtype` and `device` keyword arguments to control the data type and device of the tensor. |
| 729 | Additionally, all other keyword arguments are passed to the constructor of the tensor. |
| 730 | |
| 731 | ```python exec="true" source="above" session="tensor" result="python" |
| 732 | Tensor.manual_seed(42) |
| 733 | print(Tensor.scaled_uniform(2, 3).numpy()) |
| 734 | ``` |
| 735 | """ |
| 736 | return Tensor.uniform(*shape, low=-1.0, high=1.0, **kwargs).mul(prod(argfix(*shape))**-0.5) |
| 737 | |
| 738 | @staticmethod |
| 739 | def glorot_uniform(*shape, **kwargs) -> Tensor: |