probly.representation.torch_like.TorchLikeImplementation¶
- class probly.representation.torch_like.TorchLikeImplementation(*args, **kwargs)[source]¶
Bases:
ArrayLike,ABC,GenericABC implementation for array-like objects that behave like torch tensors.
- clone(*, memory_format: memory_format = torch.preserve_format) Self[source]¶
Return a copy of the array.
- cpu(memory_format: memory_format = torch.preserve_format) Self[source]¶
Move the array to the CPU.
- cuda(device: device | str | None = None, non_blocking: bool = False, memory_format: memory_format = torch.preserve_format) Self[source]¶
Move the array to the GPU.
- permute(*dims: Size | int | tuple[int] | list[int]) Self[source]¶
Return a permuted version of the array.
- abstractmethod size(dim: int) int[source]¶
- abstractmethod size(dim: None = None) Size
Return the size of the array along the given dimension.
- abstractmethod to(dtype: dtype, non_blocking: bool = False, copy: bool = False, *, memory_format: memory_format = torch.preserve_format) Self[source]¶
- abstractmethod to(device: device | str | None = None, dtype: dtype | None = None, non_blocking: bool = False, copy: bool = False, *, memory_format: memory_format = torch.preserve_format) Self
- abstractmethod to(other: Tensor, non_blocking: bool = False, copy: bool = False) Self
Move and/or cast the tensor, mirroring
torch.Tensor.to.