code: def cross_entropy(dist1, dist2):
      """Computes Cross entropy.
  
      For two continuous distributions :math:`p(x), q(x)`, it is expressed as
  
      .. math::
          H(p,q) = - \\int p(x) \\log q(x) dx
  
      For two discrete distributions :math:`p(x), q(x)`, it is expressed as
  
      .. math::
          H(p,q) = - \\sum_x p(x) \\log q(x)
  
      This function call :func:`~chainer.kl_divergence` and
      :meth:`~chainer.Distribution.entropy` of ``dist1``. Therefore, it is
      necessary to register KL divergence function with
      :func:`~chainer.register_kl` decoartor and define
      :meth:`~chainer.Distribution.entropy` in ``dist1``.
  
      Args:
          dist1(:class:`~chainer.Distribution`): Distribution to calculate cross
              entropy :math:`p`. This is the first (left) operand of the cross
              entropy.
          dist2(:class:`~chainer.Distribution`): Distribution to calculate cross
              entropy :math:`q`. This is the second (right) operand of the cross
              entropy.
  
      Returns:
          ~chainer.Variable: Output variable representing cross entropy
          :math:`H(p,q)`.
  
      """
      return dist1.entropy() + kl_divergence(dist1, dist2)
  
imports: import copy
  from chainer import backend
label_desc: Use image node_id 3 for calling a global function with example usage: cross_entropy(dist1, dist2) and returns: unknown