code: def _to_constrained(x, lb, ub):
      """Sigmoid and unscale."""
      x = 1.0 / (1.0 + tf.math.exp(-x))
      return x * (ub - lb) + lb
  
imports: from typing import Callable, Tuple
  import tensorflow.compat.v2
  from tf_quant_finance import black_scholes
  from tf_quant_finance import types
  from tf_quant_finance import utils
  from tf_quant_finance.black_scholes.implied_vol_utils import UnderlyingDistribution
  from tf_quant_finance.math import make_val_and_grad_fn
  from tf_quant_finance.math import optimizer
  from tf_quant_finance.models.sabr import approximations
  from tf_quant_finance.models.sabr.approximations.implied_volatility import SabrApproximationType
  from tf_quant_finance.models.sabr.approximations.implied_volatility import SabrImpliedVolatilityType
label_desc: Use image node_id 6 for calling a global function with example usage: _to_constrained(x, lb, ub) and returns: unknown