code: def reshape(data, newshape, allowzero=False):
      """Reshape the input array.
  
      To give user more convenience in without doing manual shape inference,
      some dimensions of the shape can take special values from the set {0, -1, -2, -3, -4}.
      The significance of each is explained below:
  
      ``0`` copy this dimension from the input to the output shape.
  
          .. code-block:: python
  
              data.shape = (2,3,4), newshape = (4,0,2), result.shape = (4,3,2)
              data.shape = (2,3,4), newshape = (2,0,0), result.shape = (2,3,4)
  
      Note: If the parameter allowzero is manually set to true, it specifies a
      special case where 0 actually means a true empty tensor.
  
      ``-1`` infers the dimension of the output shape by using the remainder of
      the input dimensions keeping the size of the new array same as that of the input array.
      At most one dimension of shape can be -1.
  
          .. code-block:: python
  
              data.shape = (2,3,4), newshape = (6,1,-1), result.shape = (6,1,4)
              data.shape = (2,3,4), newshape = (3,-1,8), result.shape = (3,1,8)
              data.shape = (2,3,4), newshape = (-1,), result.shape = (24,)
  
      ``-2`` copy all/remainder of the input dimensions to the output shape.
  
          .. code-block:: python
  
              data.shape = (2,3,4), newshape = (-2,), result.shape = (2,3,4)
              data.shape = (2,3,4), newshape = (2,-2), result.shape = (2,3,4)
              data.shape = (2,3,4), newshape = (-2,1,1), result.shape = (2,3,4,1,1)
  
      ``-3`` use the product of two consecutive dimensions of the input shape
      as the output dimension.
  
          .. code-block:: python
  
              data.shape = (2,3,4), newshape = (-3,4), result.shape = (6,4)
              data.shape = (2,3,4,5), newshape = (-3,-3), result.shape = (6,20)
              data.shape = (2,3,4), newshape = (0,-3), result.shape = (2,12)
              data.shape = (2,3,4), newshape = (-3,-2), result.shape = (6,4)
  
      ``-4`` split one dimension of the input into two dimensions passed subsequent
      to -4 in shape (can contain -1).
  
          .. code-block:: python
  
              data.shape = (2,3,4), newshape = (-4,1,2,-2), result.shape = (1,2,3,4)
              data.shape = (2,3,4), newshape = (2,-4,-1,3,-2), result.shape = (2,1,3,4)
  
      Parameters
      ----------
      data : relay.Expr
          The input data to the operator.
  
      newshape : Union[int, Tuple[int], List[int]] or relay.Expr
          The new shape. Should be compatible with the original shape.
  
      allowzero : Bool, optional
          If true, then treat zero as true empty tensor rather than a copy instruction.
  
      Returns
      -------
      result : relay.Expr
          The reshaped result.
      """
      if isinstance(newshape, Constant):
          newshape = list(newshape.data.numpy())
      if isinstance(newshape, Expr):
          return _dyn_make.reshape(data, newshape, allowzero)
      if isinstance(newshape, int):
          newshape = [newshape]
      if isinstance(newshape, (tuple, list)):
          tempshape = []
          for shape in newshape:
              if isinstance(shape, _expr.IntImm):
                  tempshape.append(shape.value)
              else:
                  try:
                      tempshape.append(int(shape))
                  except ValueError as err:
                      raise RuntimeError(
                          f"Unrecognized shape type: {err}"
                      )
          newshape = tempshape
      return _make.reshape(data, list(newshape), allowzero)
  
imports: from ...tir import expr
  from ..expr import Constant, Expr, Tuple, TupleWrapper, const
  from .None import _make
  from .dyn import _make
  from .tensor import shape_of
label_desc: Use image node_id 8 for calling a global function with example usage: reshape(data, newshape, allowzero) and returns: _make, _dyn_make