Copies the elements from src into self tensor and returns self. The src tensor must be broadcastable with the self tensor. It may be of a different data type or reside on a different device. See also: `https://pytorch.org/docs/stable/generated/torch.Tensor.copy_.htm
(self, src, non_blocking: bool = False, *_args, **_kwargs)
| 370 | return convert_data_type(self, output_type=output_type, dtype=dtype, device=device, wrap_sequence=True)[0] |
| 371 | |
| 372 | def set_array(self, src, non_blocking: bool = False, *_args, **_kwargs): |
| 373 | """ |
| 374 | Copies the elements from src into self tensor and returns self. |
| 375 | The src tensor must be broadcastable with the self tensor. |
| 376 | It may be of a different data type or reside on a different device. |
| 377 | |
| 378 | See also: `https://pytorch.org/docs/stable/generated/torch.Tensor.copy_.html` |
| 379 | |
| 380 | Args: |
| 381 | src: the source tensor to copy from. |
| 382 | non_blocking: if True and this copy is between CPU and GPU, the copy may occur |
| 383 | asynchronously with respect to the host. For other cases, this argument has no effect. |
| 384 | _args: currently unused parameters. |
| 385 | _kwargs: currently unused parameters. |
| 386 | """ |
| 387 | converted: torch.Tensor = convert_to_tensor(src, track_meta=False, wrap_sequence=True) |
| 388 | try: |
| 389 | return self.copy_(converted, non_blocking=non_blocking) |
| 390 | except RuntimeError: # skip the shape checking |
| 391 | self.data = converted |
| 392 | return self |
| 393 | |
| 394 | @property |
| 395 | def array(self): |
no test coverage detected