code: def set_dim(self, smooth_matrix):
      num_elements = smooth_matrix.size
      self.binary_prob_label = num_elements == 2
      if self.binary_prob_label:
          self.dim = 1
      else:
          assert np.sqrt(num_elements) ** 2 == num_elements
          self.dim = int(np.sqrt(num_elements))
  
file_path: pytorch/caffe2/python/layers/label_smooth.py
imports: from caffe2.python import core, schema
  from caffe2.python.layers.layers import ModelLayer
  import numpy
label_desc: Use image node_id 2 for calling the LabelSmooth obj's underlying member method code with example usage: obj.set_dim(smooth_matrix) without return types