class_docstr: Args:
code: def _prepare_tsn(self, num_class):
      feature_dim = getattr(
          self.base_model, self.base_model.last_layer_name
      ).in_features
      if self.dropout == 0:
          setattr(
              self.base_model,
              self.base_model.last_layer_name,
              nn.Linear(feature_dim, num_class),
          )
          self.new_fc = None
      else:
          setattr(
              self.base_model,
              self.base_model.last_layer_name,
              nn.Dropout(p=self.dropout),
          )
          self.new_fc = nn.Linear(feature_dim, num_class)
  
      std = 0.001
      if self.new_fc is None:
          normal_(
              getattr(
                  self.base_model, self.base_model.last_layer_name
              ).weight,
              0,
              std,
          )
          constant_(
              getattr(
                  self.base_model, self.base_model.last_layer_name
              ).bias,
              0,
          )
      else:
          if hasattr(self.new_fc, "weight"):
              normal_(self.new_fc.weight, 0, std)
              constant_(self.new_fc.bias, 0)
  
imports: import torch
  from torch import nn
  from torch.nn.init import normal_, constant_
  import numpy
  import torchvision
  from towhee.models.utils.basic_ops import ConsensusModule
  from towhee.models.layers.non_local import make_non_local
  from towhee.models.tsm.mobilenet_v2 import mobilenet_v2, InvertedResidual
  from towhee.models.tsm.temporal_shift import TemporalShift, make_temporal_shift
  from towhee.models.tsm.config import _C
label_desc: Use image node_id 2 for calling the TSN obj's underlying member method code with example usage: obj._prepare_tsn(num_class) without return types