code: def cross_covariance(y, z, reduce="half_squared_sum"):
      """Computes the sum-squared cross-covariance penalty between ``y`` and ``z``
  
      The output is a variable whose value depends on the value of
      the option ``reduce``. If it is ``'no'``, it holds the covariant
      matrix that has as many rows (resp. columns) as the dimension of
      ``y`` (resp.z).
      If it is ``'half_squared_sum'``, it holds the half of the
      Frobenius norm (i.e. L2 norm of a matrix flattened to a vector)
      of the covarianct matrix.
  
      Args:
          y (:class:`~chainer.Variable` or :ref:`ndarray`):
              Variable holding a matrix where the first dimension
              corresponds to the batches.
          z (:class:`~chainer.Variable` or :ref:`ndarray`):
              Variable holding a matrix where the first dimension
              corresponds to the batches.
          reduce (str): Reduction option. Its value must be either
              ``'half_squared_sum'`` or ``'no'``.
              Otherwise, :class:`ValueError` is raised.
  
      Returns:
          ~chainer.Variable:
              A variable holding the cross covariance loss.
              If ``reduce`` is ``'no'``, the output variable holds
              2-dimensional array matrix of shape ``(M, N)`` where
              ``M`` (resp. ``N``) is the number of columns of ``y``
              (resp. ``z``).
              If it is ``'half_squared_sum'``, the output variable
              holds a scalar value.
  
      .. note::
  
         This cost can be used to disentangle variables.
         See https://arxiv.org/abs/1412.6583v3 for details.
  
      """
      return CrossCovariance(reduce).apply((y, z))[0]
  
file_path: chainer/chainer/functions/loss/cross_covariance.py
imports: import chainer
  from chainer import backend
  from chainer import function_node
  from chainer import utils
  from chainer.utils import type_check
label_desc: Use image node_id 1 for calling a global function with example usage: cross_covariance(y, z, reduce) and returns: CrossCovariance