Creates a tensor with the same shape as `self`, filled with the given value. If `dtype` is not specified, the dtype of `self` is used. You can pass in the `device` keyword argument to control device of the tensor. ```python exec="true" source="above" session="tensor" result="pytho
(self, fill_value:ConstType, dtype=None, device=None)
| 601 | return Tensor(stacked.multi(self.uop.axis)) |
| 602 | |
| 603 | def full_like(self, fill_value:ConstType, dtype=None, device=None) -> Tensor: |
| 604 | """ |
| 605 | Creates a tensor with the same shape as `self`, filled with the given value. |
| 606 | If `dtype` is not specified, the dtype of `self` is used. |
| 607 | |
| 608 | You can pass in the `device` keyword argument to control device of the tensor. |
| 609 | |
| 610 | ```python exec="true" source="above" session="tensor" result="python" |
| 611 | t = Tensor.ones(2, 3) |
| 612 | print(Tensor.full_like(t, 42).numpy()) |
| 613 | ``` |
| 614 | """ |
| 615 | if device is None: return super().full_like(fill_value, dtype) |
| 616 | if isinstance(self.device, tuple): raise RuntimeError("cannot specify `device` on `full_like` of a multi device tensor") |
| 617 | return Tensor.full(self.shape, fill_value, dtype=dtype or self.dtype, device=device) |
| 618 | |
| 619 | def rand_like(self, **kwargs) -> Tensor: |
| 620 | """ |