code: def _encoder_infer_all(
      dataset, ffcv_parameters: "FFCVParameters"
  ) -> Optional["FFCVEncodeDef"]:
      """
      Infer the encoder 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.
      :return: The encoder pipeline or None if it could not be inferred.
      """
      dataset_item = dataset[0]
  
      types = []
  
      # Try to infer the field type for each element
      for item in dataset_item:
          inferred_type = _ffcv_infer_encoder(item, ffcv_parameters)
  
          if inferred_type is None:
              return None
  
          types.append(inferred_type)
  
      # Type inferred for all fields
      # Let's apply a generic name and return the dictionary
      result = OrderedDict()
      for i, t in enumerate(types):
          result[f"field_{i}"] = 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 6 for calling a global function with example usage: _encoder_infer_all(dataset, ffcv_parameters) and returns: result, None