NullableTensor#
- class sdm.tensor.NullableTensor(data: Tensor, valid: Tensor)#
Bases:
TensorA
torch.Tensorfor nullable values.- Parameters:
data (Tensor) – Tensor containing the values.
valid (Tensor) – Boolean mask indicating valid, non-null values.
- Return type:
Self
- classmethod from_arrow(array: Array | ChunkedArray, *, dtype: dtype | None = None, size: Sequence[int] | None = None, device: device | str | None = None) Self#
Create tensor from a
pyarrow.Array.- Parameters:
array (Array | ChunkedArray) – The
pyarrow.Arrayorpyarrow.ChunkedArray.dtype (dtype | None) – The dtype.
- Return type:
- to_arrow() Array#
Convert this tensor to a flat
pyarrow.Array.- Return type:
- classmethod from_cudf(ser: cudf.Series | cudf.Index, *, dtype: torch.dtype | None = None, size: Sequence[int] | None = None, device: torch.device | str | None = None) Self#
Create tensor from a
cudf.Series.- Parameters:
ser (cudf.Series | cudf.Index) – The
cudf.Seriesorcudf.Index.dtype (torch.dtype | None) – The dtype.
size (Sequence[int] | None) – The shape of the tensor.
device (torch.device | str | None) – The device.
- Return type:
Self
- to_cudf() cudf.Series#
Convert this CUDA tensor to a flat
cudf.Series.- Return type:
- classmethod from_list(values: int | bool | Sequence[Any] | None, *, dtype: dtype | None = None, device: device | str | None = None) Self#
Create tensor from a rectangular Python list.