nvidia.dali.fn.decoders.numpy#
- nvidia.dali.fn.decoders.numpy(__data, /, *, bytes_per_sample_hint=[0], dtype=None, preserve=False, device=None, name=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:
bytes_per_sample_hint¶ (int or list of int, optional, default = [0]) –
Output size hint, in bytes per sample.
If specified, the operator’s outputs residing in GPU or page-locked host memory will be preallocated to accommodate a batch of samples of this size.
dtype¶ (
nvidia.dali.types.DALIDataType
, optional) – Data type of the output tensor. If not specified, it will be inferred from the input data.preserve¶ (bool, optional, default = False) – Prevents the operator from being removed from the graph even if its outputs are not used.