code: def reshape(x, shape):
      """Reshapes an input variable without copy.
  
      Args:
          x (:class:`~chainer.Variable` or :ref:`ndarray`): Input variable.
          shape (:class:`tuple` of :class:`int` s):
              Expected shape of the output array. The number of elements which
              the array of ``shape`` contains must be equal to that of input
              array. One shape dimension can be -1. In this case, the value is
              inferred from the length of the array and remaining dimensions.
  
      Returns:
          ~chainer.Variable:
              Variable that holds a reshaped version of the input variable.
  
      .. seealso:: :func:`numpy.reshape`, :func:`cupy.reshape`
  
      .. admonition:: Example
  
          >>> x = np.array([[1, 2, 3, 4], [5, 6, 7, 8]])
          >>> y = F.reshape(x, (8,))
          >>> y.shape
          (8,)
          >>> y.array
          array([1, 2, 3, 4, 5, 6, 7, 8])
          >>> y = F.reshape(x, (4, -1))  # the shape of output is inferred
          >>> y.shape
          (4, 2)
          >>> y.array
          array([[1, 2],
                 [3, 4],
                 [5, 6],
                 [7, 8]])
          >>> y = F.reshape(x, (4, 3))  \
  # the shape of input and output are not consistent
          Traceback (most recent call last):
          ...
          chainer.utils.type_check.InvalidType:
          Invalid operation is performed in: Reshape (Forward)
          <BLANKLINE>
          Expect: prod(x.shape) == prod((4, 3))
          Actual: 8 != 12
  
      """
      if x.shape == shape:
          return chainer.as_variable(x)
      (y,) = Reshape(shape).apply((x,))
      return y
  
file_path: chainer/chainer/functions/array/reshape.py
imports: import chainer
  from chainer import function_node
  from chainer.utils import type_check
label_desc: Use image node_id 2 for calling a global function with example usage: reshape(x, shape) and returns: y, chainer