code: def transform_from_2hot(
      probs: Array, min_value: float, max_value: float, num_bins: int
  ) -> Array:
      """Transforms from a categorical distribution to a scalar."""
      support_space = jnp.linspace(
          min_value, max_value, num_bins
      ).astype(probs.dtype)
      scalar = jnp.sum(probs * jnp.expand_dims(support_space, 0), -1)
      return scalar
  
file_path: rlax/rlax/_src/transforms.py
imports: import chex
  import jax
  import jax.numpy
  from rlax._src import base
label_desc: Use image node_id 12 for calling a global function with example usage: transform_from_2hot(probs, min_value, max_value, num_bins) and returns: scalar