- classmethod DataType.tensor(dtype: daft.datatype.DataType, shape: Optional[tuple[int, ...]] = None) daft.datatype.DataType #
Create a tensor DataType: tensor arrays contain n-dimensional arrays of data of the provided
dtypeas elements, each of the provided
shapeis given, each ndarray in the column will have this shape.
shapeis not given, the ndarrays in the column can have different shapes. This is much more flexible, but will result in a less compact representation and may be make some operations less efficient.
dtype – The type of the data contained within the tensor elements.
shape – The shape of each tensor in the column. This is
Noneby default, which allows the shapes of each tensor element to vary.