code: def _decoder_infer_all(
      dataset,
      ffcv_parameters: "FFCVParameters",
      encoder_dictionary: Optional["FFCVEncodeDef"] = None,
  ) -> Optional["FFCVDecodeDef"]:
      """
      Infer the decoder pipeline from the dataset.
  
      :param dataset: The dataset to use. Must have at least
          one example.
      :param ffcv_parameters: The additional parameters passed
          to the :func:`enable_ffcv` function.
      :param encoder_dictionary: If not None, will be used as a
          basis to create the decoder pipeline.
      :return: The decoder pipeline or None if it could not be inferred.
      """
      dataset_item: Sequence[Any] = dataset[0]
  
      types: List[List["Operation"]] = []
  
      encoder_hints: List[Optional["Field"]] = []
      field_names: List[str]
  
      if encoder_dictionary is None:
          encoder_hints = [None] * len(dataset_item)
          field_names = [f"field_{i}" for i in range(len(dataset_item))]
      else:
          if len(encoder_dictionary) != len(dataset_item):
              raise ValueError(
                  "Wrong number of elements in encoder dictionary."
              )
  
          encoder_hints.extend(encoder_dictionary.values())
          field_names = list(encoder_dictionary.keys())
  
      # Try to infer the field type for each element
      for item, field_encoder in zip(dataset_item, encoder_hints):
          inferred_type = _ffcv_infer_decoder(
              item, ffcv_parameters, encoder=field_encoder
          )
  
          if inferred_type is None:
              return None
  
          types.append(inferred_type)
  
      # Type inferred for all fields
      # Let's apply the name and return the dictionary
      result = OrderedDict()
      for t, field_name in zip(types, field_names):
          result[field_name] = t
  
      return result
  
file_path: avalanche/avalanche/benchmarks/utils/ffcv_support/ffcv_support_internals.py
imports: from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Sequence, Union
  from collections import OrderedDict
  import numpy
  from torch import Tensor
  from PIL.Image import Image
  from ffcv.fields import TorchTensorField
  from ffcv.fields.decoders import IntDecoder, FloatDecoder, NDArrayDecoder, SimpleRGBImageDecoder
label_desc: Use image node_id 7 for calling a global function with example usage: _decoder_infer_all(dataset, ffcv_parameters, encoder_dictionary) and returns: result, None