code: def sum_to(x, shape):
      """Sum elements along axes to output an array of a given shape.
  
      Args:
          x (:class:`~chainer.Variable` or :ref:`ndarray`): Input variable.
          shape (tuple of int): The target shape.
  
      Returns:
          ~chainer.Variable: Output variable of shape ``shape``.
  
      .. admonition:: Example
  
          >>> x = np.array([[1., 2., 3.], [4., 5., 6.]])
          >>> x
          array([[1., 2., 3.],
                 [4., 5., 6.]])
          >>> y = F.sum_to(x, (1, 3))
          >>> y
          variable([[5., 7., 9.]])
          >>> z = F.sum_to(x, (2, 1))
          >>> z
          variable([[ 6.],
                    [15.]])
  
      """
      if x.shape == shape:
          return chainer.as_variable(x)
      (y,) = SumTo(shape).apply((x,))
      return y
  
imports: import numpy
  import six
  import chainer
  from chainer import backend
  from chainer import function_node
  from chainer import utils
  from chainer.utils import type_check
  import chainerx
label_desc: Use image node_id 2 for calling a global function with example usage: sum_to(x, shape) and returns: y, chainer