code: def __init__(
      self,
      name: str,
      in_channels: int,
      *,
      finetune: bool = True,
      pretrained: bool = False,
      backbone_config: Optional[Dict[str, Any]] = None,
  ):
      super().__init__()
      self.in_channels = in_channels
      self.encoder = BackboneEncoder(
          name,
          in_channels,
          finetune=finetune,
          pretrained=pretrained,
          backbone_config=backbone_config,
      )
      self.latent_dim = self.encoder.latent_channels
      self.pool = nn.AdaptiveAvgPool2d((1, 1))
  
imports: from torch import nn
  from torch import Tensor
  from typing import Any
  from typing import Dict
  from typing import List
  from typing import Callable
  from typing import Optional
  from cftool.array import squeeze
  from cftool.types import tensor_dict_type
  from .core import Backbone
  from ..schema import EncoderMixin
  from ..schema import Encoder1DMixin
  from .....constants import LATENT_KEY
  from .....modules.blocks import Conv2d
label_desc: Use image node_id 1 to create a new BackboneEncoder1D object from inherited base classes: nn, Encoder1DMixin with example: obj = BackboneEncoder1D(name, in_channels)