probly.representation.torch_like.TorchLike¶
- class probly.representation.torch_like.TorchLike(*args, **kwargs)[source]¶
Bases:
ArrayLike,Protocol,GenericProtocol for array-like objects that implement torch-specific APIs.
- size(dim: int) int[source]¶
- size(dim: None = None) Size
Return the size of the array along the given dimension.
- to(dtype: dtype, non_blocking: bool = False, copy: bool = False, *, memory_format: memory_format = torch.preserve_format) Self[source]¶
- 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
- to(other: Tensor, non_blocking: bool = False, copy: bool = False) Self
Move and/or cast the tensor, mirroring
torch.Tensor.to.