class_docstr: Binned uniforms distribution.
  
  Args:
      bins_lower_bound (float): The lower bound of the bin edges
      bins_upper_bound (float): The upper bound of the bin edges
      numb_bins (int): The number of equidistance bins to allocate between
          `bins_lower_bound` and `bins_upper_bound`. Default value is 100.
      logits (tensor): the logits defining the probability of each bins.
          These are softmaxed. The tensor is of shape (*batch_shape,)
      validate_args (bool) from the pytorch Distribution class
class_docstr_tok: ["Binned","uniforms","distribution",".","Args",":","bins_lower_bound","(","float",")",":","The","lower","bound","of","the","bin","edges","bins_upper_bound","(","float",")",":","The","upper","bound","of","the","bin","edges","numb_bins","(","int",")",":","The","number","of","equidistance","bins","to","allocate","between","`","bins_lower_bound","`","and","`","bins_upper_bound","`",".","Default","value","is","100.","logits","(","tensor",")",":","the","logits","defining","the","probability","of","each","bins",".","These","are","softmaxed",".","The","tensor","is","of","shape","(","*","batch_shape",",",")","validate_args","(","bool",")","from","the","pytorch","Distribution","class"]
docstr: Cumulative density tensor for a tensor of data points `x`.
  'x' is expected to be of shape (*batch_shape)
  
  The cdf is composed of 2 parts:
      the cdf up to the bin
      the cdf within the bin that the point falls into (modeled with a
      uniform distribution)
docstr_tok: ["Cumulative","density","tensor","for","a","tensor","of","data","points","`","x","`",".","'","x","'","is","expected","to","be","of","shape","(","*","batch_shape",")","The","cdf","is","composed","of","2","parts",":","the","cdf","up","to","the","bin","the","cdf","within","the","bin","that","the","point","falls","into","(","modeled","with","a","uniform","distribution",")"]
code: def _cdf_binned(self, x):
      """
      Cumulative density tensor for a tensor of data points `x`.
      'x' is expected to be of shape (*batch_shape)
  
      The cdf is composed of 2 parts:
          the cdf up to the bin
          the cdf within the bin that the point falls into (modeled with a
          uniform distribution)
      """
  
      bins_prob = self.bins_prob
  
      batch_shape_extended = bins_prob[..., 0:1].shape
  
      # Get the location of points in the bins
      one_hot_bin_indicator = self.get_one_hot_bin_indicator(x)
      # one_hot_bin_indicator.shape: (*batch_shape, numb_bins)
  
      # Get the cdf over the bins i.e. the probability mass up to each
      # bin's upper edge
      incomplete_cdf = bins_prob.cumsum(dim=-1) - bins_prob
      # incomplete_cdf.shape: (*batch_shape,numb_bins)
  
      cdf_up_to_bin = (
          (incomplete_cdf * one_hot_bin_indicator)
          .sum(dim=-1)
          .unsqueeze(dim=-1)
      )
      # incomplete_cdf.shape: (*batch_shape,1)
  
      # Prepare to select the edges of the bins that the points fall into
      upper_edges = self.bin_edges[1:].unsqueeze(dim=0)
      # upper_edges.shape: (1...,numb_bins)
      upper_edges = upper_edges.repeat(batch_shape_extended)
      # upper_edges.shape: (*batch_shape,numb_bins)
      lower_edges = self.bin_edges[:-1].unsqueeze(dim=0)
      lower_edges = lower_edges.repeat(batch_shape_extended)
      # lower_edges.shape: (*batch_shape,numb_bins)
  
      # With the edges and the point value we can get the cdf within the
      # bin given that they are uniform
      # distributions, and weight it by the probability of the bin
      bin_width = upper_edges[one_hot_bin_indicator].view(
          batch_shape_extended
      ) - lower_edges[one_hot_bin_indicator].view(batch_shape_extended)
      # bin_width.shape: (*batch_shape,1)
  
      dist_in_bin = x.unsqueeze(dim=-1) - lower_edges[
          one_hot_bin_indicator
      ].view(batch_shape_extended)
      # dist_in_bin.shape: (*batch_shape,1)
      dist_in_bin = torch.max(
          torch.min(dist_in_bin, bin_width),
          torch.zeros_like(dist_in_bin),
      )
      # this is for points falling outside the bins
  
      cdf_in_bin = (
          bins_prob[one_hot_bin_indicator].view(batch_shape_extended)
          * dist_in_bin
          / bin_width
      )
      # cdf_in_bin.shape: (*batch_shape,1)
  
      return (
          (cdf_in_bin + cdf_up_to_bin)
          .reshape(batch_shape_extended)
          .squeeze(dim=-1)
      )
  
imports: from typing import Dict, Optional, Tuple, cast
  import torch
  import torch.nn.functional
  from torch.distributions import Distribution, constraints
  from gluonts.core.component import validated
  from .distribution_output import DistributionOutput
label_desc: Use image node_id 15 for calling the BinnedUniforms obj's underlying member method code with example usage: obj._cdf_binned(x) and returns: unknown