parameters: (self, kl_fn)
return_statement: return kl_fn
docstring: Perform the KL registration.
  
      Args:
        kl_fn: The function to use for the KL divergence.
  
      Returns:
        kl_fn
  
      Raises:
        TypeError: if kl_fn is not a callable.
        ValueError: if a KL divergence function has already been registered for
          the given argument classes.
docstring_summary: Perform the KL registration.
docstring_tokens: Perform the KL registration .
function: def __call__(self, kl_fn):
      """Perform the KL registration.
  
      Args:
        kl_fn: The function to use for the KL divergence.
  
      Returns:
        kl_fn
  
      Raises:
        TypeError: if kl_fn is not a callable.
        ValueError: if a KL divergence function has already been registered for
          the given argument classes.
      """
      if not callable(kl_fn):
        raise TypeError("kl_fn must be callable, received: %s" % kl_fn)
      if self._key in _DIVERGENCES:
        raise ValueError("KL(%s || %s) has already been registered to: %s"
                         % (self._key[0].__name__, self._key[1].__name__,
                            _DIVERGENCES[self._key]))
      _DIVERGENCES[self._key] = kl_fn
      return kl_fn
function_tokens: def __call__ ( self , kl_fn ) : if not callable ( kl_fn ) : raise TypeError ( "kl_fn must be callable, received: %s" % kl_fn ) if self . _key in _DIVERGENCES : raise ValueError ( "KL(%s || %s) has already been registered to: %s" % ( self . _key [ 0 ] . __name__ , self . _key [ 1 ] . __name__ , _DIVERGENCES [ self . _key ] ) ) _DIVERGENCES [ self . _key ] = kl_fn return kl_fn