code: def view_inshape(module_masks, mask, shape):
      """
      This is a limited support
  
      TODO: consider replace tensor.view with nn.Flatten, because tensor.view is not
      included in module, thus, cannot be replaced by our framework.
  
      Parameters
      ----------
      module_masks : ModuleMasks
          The ModuleMasks instance of the ```view``` op
      mask : CoarseMask
          The mask of its input tensor
      shape : dict
          Original shape of its input and output tensors
  
      Returns
      -------
      CoarseMask
          The mask of its output tensor
      """
      # NOTE: the case constrained by the following four asserts
      assert shape["in_shape"][0] == shape["out_shape"][0]
      assert len(shape["in_shape"]) == 4
      assert len(shape["out_shape"]) == 2
      assert (
          shape["out_shape"][1]
          == shape["in_shape"][1]
          * shape["in_shape"][2]
          * shape["in_shape"][3]
      )
  
      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
      # due to the cat operation, the same node may be
      # accessed more than once
      if module_masks.input_mask is not None:
          assert module_masks.input_mask <= mask
      module_masks.set_input_mask(mask)
      output_cmask = CoarseMask(num_dim=2)
      index = []
      step_size = shape["in_shape"][2] * shape["in_shape"][3]
      for loc in mask.mask_index[1]:
          index.extend([loc * step_size + i for i in range(step_size)])
      output_cmask.add_index_mask(
          dim=1, index=torch.tensor(index).to(mask.mask_index[1].device)
      )  # pylint: disable=not-callable
      module_masks.set_output_mask(output_cmask)
      return output_cmask
  
imports: import logging
  import torch
label_desc: Use image node_id 10 for calling a global function with example usage: view_inshape(module_masks, mask, shape) and returns: output_cmask