class_docstr: Backbone base block.
  
  Args:
      backbone(`nn.Module`):
          Backbone model.
      train_backbone(`bool`):
          If backbone trained.
      name_backbone(`str`):
          Name of the backbone.
      num_channels(`int`):
          The number of the channels.
      return_interm_layers(`bool`):
          If the model returns intermediate layers.
class_docstr_tok: ["Backbone","base","block",".","Args",":","backbone","(","`","nn.Module","`",")",":","Backbone","model",".","train_backbone","(","`","bool","`",")",":","If","backbone","trained",".","name_backbone","(","`","str","`",")",":","Name","of","the","backbone",".","num_channels","(","`","int","`",")",":","The","number","of","the","channels",".","return_interm_layers","(","`","bool","`",")",":","If","the","model","returns","intermediate","layers","."]
code: def forward(self, tensor_list: NestedTensor):
      xs = self.body(tensor_list.tensors)
      out: Dict[str, NestedTensor] = {}
      for name, x in xs.items():
          m = tensor_list.mask
          assert m is not None
          mask = F.interpolate(m[None].float(), size=x.shape[-2:]).to(
              torch.bool
          )[0]
          out[name] = NestedTensor(x, mask)
      return out
  
file_path: towhee/towhee/models/coformer/backbone.py
imports: import torch
  import torch.nn.functional
  import torchvision
  from torch import nn
  from torchvision.models._utils import IntermediateLayerGetter
  from typing import Dict, List
  from towhee.models.coformer.utils import NestedTensor, is_main_process
  from towhee.models.layers.position_encoding import build_position_encoding
label_desc: Use image node_id 2 for calling the BackboneBase obj's underlying member method code with example usage: obj.forward(tensor_list) and returns: out