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: 'x' is to have shape (*batch_shape) which can be for example () or
  (32, ) or (32, 168, )
docstr_tok: ["'","x","'","is","to","have","shape","(","*","batch_shape",")","which","can","be","for","example","(",")","or","(","32",",",")","or","(","32",",","168",",",")"]
code: def get_one_hot_bin_indicator(self, x, in_float=False):
      """
      'x' is to have shape (*batch_shape) which can be for example () or
      (32, ) or (32, 168, )
      """
      for i in range(0, len(x.shape)):
          assert (
              x.shape[i] == self.batch_shape[i]
          ), "We expect the input to be a tensor of size batch_shape"
  
      numb_dim_batch_shape = len(x.shape)
  
      x_copy = x
      x = x.unsqueeze(dim=-1)
      # x.shape: (*batch_shape, 1)
  
      upper_edges = self.bin_edges[1:]
      for i in range(0, numb_dim_batch_shape):
          upper_edges = upper_edges.unsqueeze(dim=0)
      # upper_edge.shape: [1, ... ,numb_bins]
  
      lower_edge = self.bin_edges[:-1]
      for i in range(0, numb_dim_batch_shape):
          lower_edge = lower_edge.unsqueeze(dim=0)
      # lower_edge.shape: [1, ... ,numb_bins]
  
      one_hot_bin_indicator = (
          (lower_edge <= x) * (x < upper_edges)
      ).long()
      # one_hot_bin_indicator.shape: [*batch_shape, numb_bins]
  
      # This handles if x falls outside of [self.bin_min, self.bin_max]
      is_higher_than_last_edge = x_copy >= self.bin_edges[..., -1]
      # is_higher_than_last_edge: [*batch_shape, numb_dim]
      is_lower_than_first_edge = x_copy <= self.bin_edges[..., 0]
      # is_lower_than_first_edge: [*batch_shape, numb_dim]
  
      one_hot_bin_indicator[..., -1][is_higher_than_last_edge] = 1
      one_hot_bin_indicator[..., 0][is_lower_than_first_edge] = 1
  
      if not in_float:
          return one_hot_bin_indicator == 1  # booleans
      else:
          return one_hot_bin_indicator.float()
  
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 10 for calling the BinnedUniforms obj's underlying member method code with example usage: obj.get_one_hot_bin_indicator(x, in_float) and returns: unknown, one_hot_bin_indicator