code: def histogram(
      x: torch.Tensor,
      bins: torch.Tensor,
      bandwidth: torch.Tensor,
      epsilon: float = 1e-10,
  ) -> torch.Tensor:
      """Estimate the histogram of the input tensor.
  
      The calculation uses kernel density estimation which requires a bandwidth (smoothing) parameter.
  
      Args:
          x: Input tensor to compute the histogram with shape :math:`(B, D)`.
          bins: The number of bins to use the histogram :math:`(N_{bins})`.
          bandwidth: Gaussian smoothing factor with shape shape [1].
          epsilon: A scalar, for numerical stability.
  
      Returns:
          Computed histogram of shape :math:`(B, N_{bins})`.
  
      Examples:
          >>> x = torch.rand(1, 10)
          >>> bins = torch.torch.linspace(0, 255, 128)
          >>> hist = histogram(x, bins, bandwidth=torch.tensor(0.9))
          >>> hist.shape
          torch.Size([1, 128])
      """
      pdf, _ = marginal_pdf(x.unsqueeze(2), bins, bandwidth, epsilon)
  
      return pdf
  
imports: from typing import Optional, Tuple
  import torch
label_desc: Use image node_id 3 for calling a global function with example usage: histogram(x, bins, bandwidth, epsilon) and returns: pdf