code: def __init__(self, config: CNNEncoderConfig) -> None:
      TorchModel.__init__(self, config)
      Encoder.__init__(self, config)
  
      layers = []
      # The bare-bones CNN (no flatten, no succeeding dense).
      cnn = TorchCNN(
          input_dims=config.input_dims,
          cnn_filter_specifiers=config.cnn_filter_specifiers,
          cnn_activation=config.cnn_activation,
          cnn_use_layernorm=config.cnn_use_layernorm,
          cnn_use_bias=config.cnn_use_bias,
          cnn_kernel_initializer=config.cnn_kernel_initializer,
          cnn_kernel_initializer_config=config.cnn_kernel_initializer_config,
          cnn_bias_initializer=config.cnn_bias_initializer,
          cnn_bias_initializer_config=config.cnn_bias_initializer_config,
      )
      layers.append(cnn)
  
      # Add a flatten operation to move from 2/3D into 1D space.
      if config.flatten_at_end:
          layers.append(nn.Flatten())
  
      # Create the network from gathered layers.
      self.net = nn.Sequential(*layers)
  
imports: from typing import Optional
  import tree
  from ray.rllib.core.models.base import Encoder, ActorCriticEncoder, StatefulActorCriticEncoder, STATE_IN, STATE_OUT, ENCODER_OUT
  from ray.rllib.core.models.base import Model, tokenize
  from ray.rllib.core.models.configs import ActorCriticEncoderConfig, CNNEncoderConfig, MLPEncoderConfig, RecurrentEncoderConfig
  from ray.rllib.core.models.specs.specs_base import Spec
  from ray.rllib.core.models.specs.specs_base import TensorSpec
  from ray.rllib.core.models.specs.specs_dict import SpecDict
  from ray.rllib.core.models.torch.base import TorchModel
  from ray.rllib.core.models.torch.primitives import TorchMLP, TorchCNN
  from ray.rllib.models.utils import get_initializer_fn
  from ray.rllib.policy.sample_batch import SampleBatch
  from ray.rllib.utils.annotations import override
  from ray.rllib.utils.framework import try_import_torch
label_desc: Use image node_id 1 to create a new TorchCNNEncoder object from inherited base classes: TorchModel, Encoder with example: obj = TorchCNNEncoder(config)