class_docstr: Helper to scale `scales` before quantizing if to integer indices.
  
  Log quantization grid that aligns woth how scales are distributed
docstr: Convert index to scale
docstr_tok: ["Convert","index","to","scale"]
code: def from_scale_idx(self, idx: Tensor) -> Tensor:
      """Convert index to scale"""
      out = idx / (self.num_bins - 1)
      normalizer = self.scales_max / self.scales_min
      normalizer = (
          normalizer + 1
      )  # log(max+min) - log(min) = log(max / min + 1)
      out = out * math.log(normalizer)
      return torch.exp(out + math.log(self.scales_min))
  
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 3 for calling the Scaler obj's underlying member method code with example usage: obj.from_scale_idx(idx) and returns: torch