class_docstr: Gaussian Conditional prior with mean and scale indexes
docstr: Args:
      index_ranges: a tuple (num_means, num_scales)
      scale_bound: scale lower bound, must be positive. Defaults to 0.01.
      tail_mass: tail mass. Defaults to (2 ** (-8)).
      precision: precision for the entropy coder. Defaults to 12.
      scaler: helper to map scales to indexes, see `Scaler`.
          Defaults to Scaler(num_bins=256, scales_min=0.01).
docstr_tok: ["Args",":","index_ranges",":","a","tuple","(","num_means",",","num_scales",")","scale_bound",":","scale","lower","bound",",","must","be","positive",".","Defaults","to","0.01.","tail_mass",":","tail","mass",".","Defaults","to","(","2","*","*","(","-8",")",")",".","precision",":","precision","for","the","entropy","coder",".","Defaults","to","12.","scaler",":","helper","to","map","scales","to","indexes",",","see","`","Scaler","`",".","Defaults","to","Scaler","(","num_bins=256",",","scales_min=0.01",")","."]
code: def __init__(
      self,
      index_ranges: Tuple[int, int],  # [n_means, n_scales]
      *args: Any,
      scale_bound: float = 0.01,
      tail_mass: float = (2 ** (-8)),
      precision: int = 12,
      scaler: Scaler = Scaler(num_bins=256, scales_min=0.01),
      **kwargs: Any,
  ):
      """
      Args:
          index_ranges: a tuple (num_means, num_scales)
          scale_bound: scale lower bound, must be positive. Defaults to 0.01.
          tail_mass: tail mass. Defaults to (2 ** (-8)).
          precision: precision for the entropy coder. Defaults to 12.
          scaler: helper to map scales to indexes, see `Scaler`.
              Defaults to Scaler(num_bins=256, scales_min=0.01).
      """
      super().__init__(*args, **kwargs)
      self.precision = precision
      self._index_ranges = tuple(int(r) for r in index_ranges)
      self._num_means = self._index_ranges[0]
      self._not_one_mean = self._num_means != 1
      self._num_scales = self._index_ranges[1]
  
      if scaler.num_bins != self._num_scales:
          raise ValueError(
              "Number of bins in `scaler` must match number of scales"
          )
      self._scaler = scaler
      self.tail_mass = float(tail_mass)
  
      if scale_bound <= 0:
          raise ValueError("Invalid parameters")
      self.lower_bound_scale = LowerBound(scale_bound)
      self.lower_bound_zero = LowerBound(0.0)
      # TODO make an actual upperbound:
      self.upper_bound_mean = LowerBound(-float(index_ranges[0] - 1))
      self.upper_bound_scale = LowerBound(-float(index_ranges[1] - 1))
  
      self.register_buffer(
          "scale_bound", torch.Tensor([float(scale_bound)])
      )
      self.register_buffer(
          "_indexes_table", torch.Tensor()
      )  # [n_means, n_scales, 2]
      # the tensors _prior_mean  _prior_scale and will be of shape [n_means, n_scales]
      # after runing `update tables`. All means (scales) are equal across columns (rows)
      # and are in an increasing order.
      self.register_buffer("_prior_mean", torch.Tensor())
      self.register_buffer("_prior_scale", torch.Tensor())
      self._prior_dtype = torch.float32
  
imports: import math
  from typing import Any, List, Optional, Tuple
  import scipy.stats
  import torch
  import torch.nn
  from compressai.entropy_models import EntropyModel
  from compressai.ops import LowerBound
  from torch import Tensor
label_desc: Use image node_id 1 to create a new ContinuousIndexedGaussianConditional object from inherited base classes: EntropyModel with example: obj = ContinuousIndexedGaussianConditional(index_ranges)