Inflates/decompresses the input using specified decompression algorithm.
The input must be a 1D tensor of bytes (uint8). Passing the
dtypeof the decompressed samples is required.
Each input sample can either be a single compressed chunk or consist of multiple compressed chunks that have the same shape and type when inflated, so that they can be be merged into a single tensor where the outermost extent of the tensor corresponds to the number of the chunks.
If the sample is comprised of multiple chunks, the
chunk_sizesmust be specified. In that case, the
shapemust describe the shape of a single inflated (output) chunk. The number of the chunks will automatically be added as the outermost extent to the output tensors.
For example, the following snippet presents decompression of a video-like sequences. Each video sequence was deflated by, first, compressing each frame separately and then concatenating compressed frames from the corresponding sequences.:
@pipeline_def def inflate_sequence_pipeline(): compressed_seq, uncompressed_hwc_shape, compressed_chunk_sizes = fn.external_source(...) sequences = fn.experimental.inflate( compressed_seq.gpu(), chunk_sizes=compressed_chunk_sizes, # refers to sizes in ``compressed_seq`` shape=uncompressed_hwc_shape, layout="HWC", sequence_axis_name="F") return sequences
- Supported backends
input (TensorList) – Input to the operator.
- Keyword Arguments
shape (int or list of int or TensorList of int) – The shape of the output (inflated) chunk.
algorithm (str, optional, default = ‘LZ4’) –
Algorithm to be used to decode the data.
bytes_per_sample_hint (int or list of int, optional, default = ) –
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.
chunk_offsets (int or list of int or TensorList of int, optional) –
A list of offsets within the input sample describing where the consecutive chunks begin.
chunk_sizesis not specified, it is assumed that the chunks are densely packed in the input tensor and the last chunk ends with the sample’s end.
chunk_sizes (int or list of int or TensorList of int, optional) –
A list of sizes of corresponding input chunks.
chunk_offsetsis not specified, it is assumed that the chunks are densely packed in the input tensor and the first chunk starts at the beginning of the sample.
nvidia.dali.types.DALIDataType, optional, default = DALIDataType.UINT8) – The output (inflated) data type.
layout (layout str, optional, default = ‘’) –
Layout of the output (inflated) chunk.
If the samples consist of multiple chunks, additionally, the
sequence_axis_nameextent will be added to the beginning of the specified layout.
preserve (bool, optional, default = False) – Prevents the operator from being removed from the graph even if its outputs are not used.
seed (int, optional, default = -1) –
If not provided, it will be populated based on the global seed of the pipeline.
sequence_axis_name (layout str, optional, default = ‘F’) –
The name for the sequence axis.
If the samples consist of multiple chunks, an extra outer dimension will be added to the output tensor. By default, it is assumed to be video frames, hence the default label ‘F’
The value is ignored if the
layoutis not specified or the input is not a sequence ( neither