class_docstr: Args:
code: def forward(self, input_x):
      self.shape = input_x.size()
      if self.consensus_type == "avg":
          output = input_x.mean(dim=self.dim, keepdim=True)
      elif self.consensus_type == "identity":
          output = input_x
      else:
          output = None
  
      return output
  
file_path: towhee/towhee/models/utils/basic_ops.py
imports: import torch
label_desc: Use image node_id 2 for calling the SegmentConsensus obj's underlying member method code with example usage: obj.forward(input_x) and returns: output