code: def _init_inputs(self, in_channels, in_index, in_transform):
      assert in_transform in [None, "resize_concat", "multiple_select"]
      if in_transform is not None:
          assert len(in_channels) == len(in_index)
          if in_transform == "resize_concat":
              self.last_channels = sum(in_channels)
          else:
              self.last_channels = in_channels[0]
      else:
          assert isinstance(in_channels, int)
          assert isinstance(in_index, int)
          self.last_channels = in_channels
  
file_path: PaddleSeg/paddleseg/models/topformer.py
imports: import warnings
  import paddle
  import paddle.nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager
  from paddleseg.models import layers
  from paddleseg.utils import utils
  from paddleseg.models.backbones.top_transformer import ConvBNAct
label_desc: Use image node_id 2 for calling the TopFormerHead obj's underlying member method code with example usage: obj._init_inputs(in_channels, in_index, in_transform) without return types