code: def _shape_array(self, array, current, total):
      # ogrid
      if self.sparse:
          new_shape = [1] * total
          new_shape[current - 1] = self.shapes[current - 1]
          return ivy.reshape(array, new_shape)
      # mgrid
      if current != total:
          array = self._init_array(array, current, total)
      while current != 1:
          new_shape = [1] + self.shapes[current - 1 : total]
          array = ivy.reshape(array, new_shape)
          array = ivy.repeat(array, self.shapes[current - 2], axis=0)
          current -= 1
      array = ivy.reshape(array, [1] + self.shapes)
      return array
  
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import outputs_to_frontend_arrays, to_ivy_arrays_and_back, handle_numpy_dtype
label_desc: Use image node_id 6 for calling the nd_grid obj's underlying member method code with example usage: obj._shape_array(array, current, total) and returns: array, ivy