code: def quantize_enumerate(x_real, min, max, num_quant_bins=4):
      """Quantize, then manually enumerate."""
      assert _all(min < max)
      lb = x_real.detach().floor()
  
      probs = compute_bin_probs(
          x_real - lb, num_quant_bins=num_quant_bins
      )
      logits = safe_log(probs)
  
      arange_min = 1 - num_quant_bins // 2
      arange_max = 1 + num_quant_bins // 2
      q = torch.arange(arange_min, arange_max)
  
      x = lb.unsqueeze(-1) + q
      x = torch.max(x, 2 * _unsqueeze(min) - 1 - x)
      x = torch.min(x, 2 * _unsqueeze(max) + 1 - x)
  
      return x, logits
  
file_path: pyro/pyro/contrib/epidemiology/util.py
imports: import numpy
  import torch
  import pyro
  import pyro.distributions
  import pyro.poutine
  from pyro.distributions.util import broadcast_shape
  from pyro.ops.special import safe_log
label_desc: Use image node_id 8 for calling a global function with example usage: quantize_enumerate(x_real, min, max, num_quant_bins) and returns: x,  logits