code: def batchnorm2d_inshape(module_masks, mask):
      """
      We assume only the second dimension has coarse grained mask
  
      Parameters
      ----------
      module_masks : ModuleMasks
          The ModuleMasks instance of the batchnorm2d
      mask : CoarseMask
          The mask of its input tensor
  
      Returns
      -------
      CoarseMask
          The mask of its output tensor
      """
      assert isinstance(mask, CoarseMask)
      assert mask.mask_index[1] is not None
      assert mask.mask_index[0] is None
      assert mask.mask_index[2] is None
      assert mask.mask_index[3] is None
      module_masks.set_input_mask(mask)
      module_masks.set_output_mask(mask)
      weight_cmask = CoarseMask(num_dim=1)
      weight_cmask.add_index_mask(dim=0, index=mask.mask_index[1])
      module_masks.set_param_masks("weight", weight_cmask)
      module_masks.set_param_masks("bias", weight_cmask)
      return mask
  
imports: import logging
  import torch
label_desc: Use image node_id 7 for calling a global function with example usage: batchnorm2d_inshape(module_masks, mask) and returns: mask