class_docstr: Binned univariate distribution designed as an nn.Module
  
  Arguments
  ----------
  bins_lower_bound: The lower bound of the bin edges
  bins_upper_bound: The upper bound of the bin edges
  nbins: The number of equidistance bins to allocate between `bins_lower_bound` and `bins_upper_bound`. Default value is 100.
  smoothing_indicator: The method of smoothing to perform on the bin probabilities
docstr: Cumulative density given bins for one datapoint `xx`, where
  `cum_density` is the cdf up to bin_edges `idx`  which must be lower
  than `xx`
docstr_tok: ["Cumulative","density","given","bins","for","one","datapoint","`","xx","`",",","where","`","cum_density","`","is","the","cdf","up","to","bin_edges","`","idx","`","which","must","be","lower","than","`","xx","`"]
code: def cdf_binned_components(
      self, xx, idx=0, cum_density=torch.tensor([0.0])
  ):
      """
      Cumulative density given bins for one datapoint `xx`, where
      `cum_density` is the cdf up to bin_edges `idx`  which must be lower
      than `xx`
      """
      assert (
          xx.shape.numel() == 1
      ), "cdf_components() expects univariate"
  
      bins_range = self.bin_edges[-1] - self.bin_edges[0]
      bin_cdf_relative = torch.tensor([0.0])
      if idx == 0:
          cum_density = torch.tensor([0.0])
  
      while xx > self.bin_edges[idx] and idx < self.nbins:
          bin_width = self.bin_edges[idx + 1] - self.bin_edges[idx]
          if xx < self.bin_edges[idx + 1]:
              bin_cdf = torch.distributions.uniform.Uniform(
                  self.bin_edges[idx], self.bin_edges[idx + 1]
              ).cdf(xx)
              bin_cdf_relative = bin_cdf * bin_width / bins_range
              break
          else:
              cum_density += self.bins_prob()[idx] * bin_width
              idx += 1
      return idx, cum_density, bin_cdf_relative
  
imports: from typing import Optional
  import numpy
  import torch
  import torch.nn
  import torch.nn.functional
  import torch.optim
  from .genpareto import GenPareto
label_desc: Use image node_id 10 for calling the Binned obj's underlying member method code with example usage: obj.cdf_binned_components(xx, idx, cum_density) and returns: idx,  cum_density,  bin_cdf_relative