class_docstr: This layer aims to build a mapping from raw keys to indices within [0, max_index).
  The mapping is continuously built during training. The mapping will be frozen during
  evaluation and prediction. Unseen keys will be assigned to index 0.
code: def add_train_ops(self, net):
      if self.input_record.field_type().base != np.int64:
          keys = net.Cast(
              self.input_record(),
              net.NextScopedBlob("indices_before_mapping"),
              to=core.DataType.INT64,
          )
      else:
          keys = self.input_record()
  
      # Load keys into indices
      indices = net.IndexGet(
          [self.handler, keys], self.output_schema.indices()
      )
  
      net.StopGradient(indices, indices)
  
file_path: pytorch/caffe2/python/layers/build_index.py
imports: import numpy
  from caffe2.python import core, schema
  from caffe2.python.layers.layers import ModelLayer
label_desc: Use image node_id 2 for calling the MapToRange obj's underlying member method code with example usage: obj.add_train_ops(net) without return types