class_docstr: Coarse grained mask for a given tensor, here tensor could be weights,
  input tensor, or output tensor
class_docstr_tok: ["Coarse","grained","mask","for","a","given","tensor",",","here","tensor","could","be","weights",",","input","tensor",",","or","output","tensor"]
docstr: Add mask for the specified dimension
  
  Parameters
  ----------
  dim : int
      The dimension to add mask
  index : tensor
      The mask for this dimension, its a 1 dimension tensor which specifies
      the index of the elements that are not pruned
docstr_tok: ["Add","mask","for","the","specified","dimension","Parameters","--","--","--","--","--","dim",":","int","The","dimension","to","add","mask","index",":","tensor","The","mask","for","this","dimension",",","its","a","1","dimension","tensor","which","specifies","the","index","of","the","elements","that","are","not","pruned"]
code: def add_index_mask(self, dim, index):
      """
      Add mask for the specified dimension
  
      Parameters
      ----------
      dim : int
          The dimension to add mask
      index : tensor
          The mask for this dimension, its a 1 dimension tensor which specifies
          the index of the elements that are not pruned
      """
      self.mask_index[dim] = index
  
imports: import logging
  import torch
label_desc: Use image node_id 2 for calling the CoarseMask obj's underlying member method code with example usage: obj.add_index_mask(dim, index) without return types