Types#
- class lfeats.Container(data: ndarray | Tensor)[source]#
Dataclass to hold generic data.
- property array: ndarray#
Get the data as a NumPy array.
- Returns:
- outnp.ndarray
The data as a NumPy array.
- is_array() bool[source]#
Check if the data is a NumPy array.
- Returns:
- outbool
True if the data is a NumPy array, False otherwise.
- is_tensor() bool[source]#
Check if the data is a PyTorch tensor.
- Returns:
- outbool
True if the data is a PyTorch tensor, False otherwise.
- property ndim: int#
Get the number of dimensions of the data.
- Returns:
- outint
The number of dimensions of the data.
- property shape: tuple[int, ...]#
Get the shape of the data.
- Returns:
- outtuple[int, …]
The shape of the data.
- property tensor: Tensor#
Get the data as a PyTorch tensor.
- Returns:
- outtorch.Tensor
The data as a PyTorch tensor.