code: def log_binomial(n, k, tol=0.0):
      """
      Computes log binomial coefficient.
  
      When ``tol >= 0.02`` this uses a shifted Stirling's approximation to the
      log Beta function via :func:`log_beta`.
  
      :param torch.Tensor n: A nonnegative integer tensor.
      :param torch.Tensor k: An integer tensor ranging in ``[0, n]``.
      :rtype: torch.Tensor
      """
      assert isinstance(tol, (float, int)) and tol >= 0
      n_plus_1 = n + 1
      if tol < 0.02:
          # At small tolerance it is cheaper to defer to torch.lgamma().
          return (
              n_plus_1.lgamma()
              - (k + 1).lgamma()
              - (n_plus_1 - k).lgamma()
          )
  
      return -n_plus_1.log() - log_beta(k + 1, n_plus_1 - k, tol=tol)
  
file_path: pyro/pyro/ops/special.py
imports: import functools
  import math
  import operator
  import weakref
  from typing import Dict
  import numpy
  import torch
  from numpy.polynomial.hermite import hermgauss
label_desc: Use image node_id 3 for calling a global function with example usage: log_binomial(n, k, tol) and returns: unknown, unknown