class_docstr: Decoder for :class:`~ffcv.fields.RGBImageField` that performs a center crop operation.
  
  It supports both variable and constant resolution datasets.
  
  Differently from the original CenterCropRGBImageDecoder from FFCV,
  this operates like torchvision CenterCrop.
code: def generate_code(self) -> Callable:
      jpg = IMAGE_MODES["jpg"]
  
      mem_read = self.memory_read
      my_range = Compiler.get_iterator()
      imdecode_c = Compiler.compile(imdecode)
      c_crop = Compiler.compile(self.get_crop_generator)
      output_size = self.output_size
  
      def decode(batch_indices, my_storage, metadata, storage_state):
          destination, temp_storage = my_storage
          for dst_ix in my_range(len(batch_indices)):
              source_ix = batch_indices[dst_ix]
              field = metadata[source_ix]
              image_data = mem_read(field["data_ptr"], storage_state)
              height = np.uint32(field["height"])
              width = np.uint32(field["width"])
  
              if field["mode"] == jpg:
                  temp_buffer = temp_storage[dst_ix]
                  imdecode_c(
                      image_data,
                      temp_buffer,
                      height,
                      width,
                      height,
                      width,
                      0,
                      0,
                      1,
                      1,
                      False,
                      False,
                  )
                  selected_size = 3 * height * width
                  temp_buffer = temp_buffer.reshape(-1)[:selected_size]
                  temp_buffer = temp_buffer.reshape(height, width, 3)
              else:
                  temp_buffer = image_data.reshape(height, width, 3)
  
              c_crop(
                  height,
                  width,
                  output_size,
                  temp_buffer,
                  destination[dst_ix],
              )
  
          return destination[: len(batch_indices)]
  
      decode.is_parallel = True
      return decode
  
file_path: avalanche/avalanche/benchmarks/utils/ffcv_support/center_crop.py
imports: from typing import Callable, Tuple
  from ffcv.fields.decoders import SimpleRGBImageDecoder
  from ffcv.pipeline.state import State
  from ffcv.pipeline.allocation_query import AllocationQuery
  import numpy
  from dataclasses import replace
  from ffcv.fields.rgb_image import IMAGE_MODES
  from ffcv.pipeline.compiler import Compiler
  from ffcv.libffcv import imdecode
label_desc: Use image node_id 3 for calling the CenterCropRGBImageDecoderTVAlike obj's underlying member method code with example usage: obj.generate_code() and returns: decode, destination