nvidia.dali.experimental.dynamic.decoders.numpy#

nvidia.dali.experimental.dynamic.decoders.numpy(data, /, *, batch_size=None, device=None, dtype=None)#

Decodes NumPy arrays from a serialized npy file. The input should be a 1D uint8 tensor containing the binary data of the NumPy file. All samples in the batch must have the same number of dimensions and data type (unless dtype is specified which casts all samples in the batch to this dtype). The output will be a tensor with the same shape and data type as the original NumPy array.

If the dtype argument is not specified, it will be inferred from the input data. The operator supports both C-style (C-contiguous) and Fortran-style (Fortran-contiguous) arrays. The operator does not support decoding of NumPy arrays with complex data types (e.g., structured arrays) and will raise an error if the file is not Format Version 1.0.

Supported backends
  • ‘cpu’

Parameters:

data (1D Tensor) – Input that contains the binary data of the NumPy array.

Keyword Arguments:

dtype (nvidia.dali.types.DALIDataType, optional) – Data type of the output tensor. If not specified, it will be inferred from the input data.