code: def register_kl(Dist1, Dist2):
      """Decorator to register KL divergence function.
  
      This decorator registers a function which computes Kullback-Leibler
      divergence. This function will be called by :func:`~chainer.kl_divergence`
      based on the argument types.
  
      Args:
          Dist1(`type`): type of a class inherit from
              :class:`~chainer.Distribution` to calculate KL divergence.
          Dist2(`type`): type of a class inherit from
              :class:`~chainer.Distribution` to calculate KL divergence.
  
      The decorated functoion takes an instance of ``Dist1`` and ``Dist2`` and
      returns KL divergence value.
  
      .. admonition:: Example
  
          This is a simple example to register KL divergence. A function to
          calculate a KL divergence value between an instance of ``Dist1`` and
          an instance of ``Dist2`` is registered.
  
          .. code-block:: python
  
              from chainer import distributions
              @distributions.register_kl(Dist1, Dist2)
              def _kl_dist1_dist2(dist1, dist2):
                  return KL
  
      """
  
      def f(kl):
          _KLDIVERGENCE[Dist1, Dist2] = kl
  
      return f
  
imports: import copy
  from chainer import backend
label_desc: Use image node_id 1 for calling a global function with example usage: register_kl(Dist1, Dist2) and returns: f