code: def add_ops(self, net):
      label = self.input_record.label.field_blobs()
      if self.label_smoothing_matrix is not None:
          label = [self.compute_smoothed_label(net)]
      elif not self.label_prob:
          if self.input_record.label.field_types()[0].base != np.int32:
              label = [
                  net.Cast(
                      label,
                      net.NextScopedBlob("int32_label"),
                      to=core.DataType.INT32,
                  )
              ]
  
      softmax_input = self.input_record.prediction.field_blobs() + label
  
      if "weight" in self.input_record:
          weight_blob = self.input_record.weight()
          if self.input_record.weight.field_type().base != np.float32:
              weight_blob = net.Cast(
                  weight_blob,
                  weight_blob + "_float32",
                  to=core.DataType.FLOAT,
              )
  
          softmax_input += [weight_blob]
  
      net.SoftmaxWithLoss(
          softmax_input,
          self.output_schema.field_blobs(),
          label_prob=self.label_prob,
          scale=self.scale,
          average_by_batch_size=self.average_by_batch_size,
      )
  
file_path: pytorch/caffe2/python/layers/batch_softmax_loss.py
imports: from caffe2.python import core, schema
  from caffe2.python.layers.layers import ModelLayer
  import numpy
label_desc: Use image node_id 4 for calling the BatchSoftmaxLoss obj's underlying member method code with example usage: obj.add_ops(net) without return types