class_docstr: Transform using the given torch.nn.Module.
  
  This covers those transformations implemented as a torch module which
  are not already translated from torchvision.
  
  This is a smarter version of the FFCV wrapper as it allows
  having NumPy inputs and setting explicit shapes for input and outputs.
  
  Parameters
  ----------
  module: torch.nn.Module
      The module for transformation
class_docstr_tok: ["Transform","using","the","given","torch.nn.Module",".","This","covers","those","transformations","implemented","as","a","torch","module","which","are","not","already","translated","from","torchvision",".","This","is","a","smarter","version","of","the","FFCV","wrapper","as","it","allows","having","NumPy","inputs","and","setting","explicit","shapes","for","input","and","outputs",".","Parameters","--","--","--","--","--","module",":","torch.nn.Module","The","module","for","transformation"]
docstr: Creates an instance of a SmartModuleWrapper.
  
  :param module: The module to use. The module must be able to process
      the inputs in batches.
  :param expected_out_type: The expected type of the output. Default to `as_previous`.
  :param expected_shape: The expected shape of the output. Default to `as_previous`.
  :param smart_reshape: If True, will try to compute the proper shape conversion
      when the input is NumPy and the shape suggests that an image is being passed.
docstr_tok: ["Creates","an","instance","of","a","SmartModuleWrapper",".",":","param","module",":","The","module","to","use",".","The","module","must","be","able","to","process","the","inputs","in","batches",".",":","param","expected_out_type",":","The","expected","type","of","the","output",".","Default","to","`","as_previous","`",".",":","param","expected_shape",":","The","expected","shape","of","the","output",".","Default","to","`","as_previous","`",".",":","param","smart_reshape",":","If","True",",","will","try","to","compute","the","proper","shape","conversion","when","the","input","is","NumPy","and","the","shape","suggests","that","an","image","is","being","passed","."]
code: def __init__(
      self,
      module: torch.nn.Module,
      expected_out_type: Union[
          np.dtype, torch.dtype, Literal["as_previous"]
      ] = "as_previous",
      expected_shape: Union[
          Tuple[int, ...], Literal["as_previous"]
      ] = "as_previous",
      smart_reshape: bool = True,
  ):
      """
      Creates an instance of a SmartModuleWrapper.
  
      :param module: The module to use. The module must be able to process
          the inputs in batches.
      :param expected_out_type: The expected type of the output. Default to `as_previous`.
      :param expected_shape: The expected shape of the output. Default to `as_previous`.
      :param smart_reshape: If True, will try to compute the proper shape conversion
          when the input is NumPy and the shape suggests that an image is being passed.
      """
      super().__init__()
      self.module = module
      self.expected_out_type = expected_out_type
      self.expected_shape = expected_shape
      self.input_type = "numpy"
      self.output_type = "numpy"
      self.smart_reshape = smart_reshape
  
imports: from typing import Any, Callable, Dict, List, NamedTuple, Optional, Tuple, Type, Union
  from typing_extensions import Literal
  import warnings
  import numpy
  import torch
  from avalanche.benchmarks.utils.transforms import flat_transforms_recursive
  from avalanche.benchmarks.utils.ffcv_support.center_crop import CenterCropRGBImageDecoderTVAlike
  from torchvision.transforms import ToTensor
  from torchvision.transforms import PILToTensor
  from torchvision.transforms import Normalize
  from torchvision.transforms import ConvertImageDtype
  from torchvision.transforms import RandomResizedCrop
  from torchvision.transforms import CenterCrop
  from torchvision.transforms import RandomHorizontalFlip
  from torchvision.transforms import RandomCrop
  from ffcv.transforms import ToTensor
  from ffcv.transforms import ToDevice
  from ffcv.transforms import ToTorchImage
  from ffcv.transforms import NormalizeImage
  from ffcv.transforms import Convert
  from ffcv.transforms import View
  from ffcv.transforms import Squeeze
  from ffcv.transforms import RandomResizedCrop
  from ffcv.transforms import RandomHorizontalFlip
  from ffcv.transforms import RandomTranslate
  from ffcv.transforms import Cutout
  from ffcv.transforms import ImageMixup
  from ffcv.transforms import LabelMixup
  from ffcv.transforms import MixupToOneHot
  from ffcv.transforms import Poison
  from ffcv.transforms import ReplaceLabel
  from ffcv.transforms import RandomBrightness
  from ffcv.transforms import RandomContrast
  from ffcv.transforms import RandomSaturation
  from ffcv.transforms import ModuleWrapper
  from ffcv.pipeline.operation import Operation
  from ffcv.pipeline.state import State
  from ffcv.pipeline.allocation_query import AllocationQuery
  from ffcv.fields.decoders import SimpleRGBImageDecoder, RandomResizedCropRGBImageDecoder
  from dataclasses import replace
label_desc: Use image node_id 1 to create a new SmartModuleWrapper object from inherited base classes: Operation with example: obj = SmartModuleWrapper(module, expected_out_type, expected_shape, smart_reshape)