code: def get_2d_indices(indices, layout="NCHW"):
      """Get 2d indices"""
      (cc, inum, ic) = (0, 0, 0)
      if layout == "NHWC":
          n, y, x, c = indices
          cc = None
      elif layout == "NCHW":
          n, c, y, x = indices
          cc = None
      elif nchw_pack_layout(layout):
          n, c, y, x, inum, ic = indices
      else:
          # else must be NCHWxc
          assert nchw_xc_layout(layout)
          n, c, y, x, cc = indices
  
      return n, c, y, x, cc, inum, ic
  
imports: from __future__ import absolute_import
  import tvm
  from tvm import te
  from tvm.topi.utils import nchw_pack_layout, nchw_xc_layout
  from ..None import tag
label_desc: Use image node_id 3 for calling a global function with example usage: get_2d_indices(indices, layout) and returns: n,  c,  y,  x,  cc,  inum,  ic