code: def parametrized_bottleneck(x, hparams):
      """Meta-function calling all the above bottlenecks with hparams."""
      if hparams.bottleneck_kind == "tanh_discrete":
          d, _ = tanh_discrete_bottleneck(
              x,
              hparams.bottleneck_bits,
              hparams.bottleneck_noise * 0.5,
              hparams.discretize_warmup_steps,
              hparams.mode,
          )
          return d, 0.0
      if hparams.bottleneck_kind == "isemhash":
          return isemhash_bottleneck(
              x,
              hparams.bottleneck_bits,
              hparams.bottleneck_noise * 0.5,
              hparams.discretize_warmup_steps,
              hparams.mode,
              hparams.isemhash_noise_dev,
              hparams.isemhash_mix_prob,
          )
      if hparams.bottleneck_kind == "vq":
          return vq_discrete_bottleneck(
              x,
              hparams.bottleneck_bits,
              hparams.vq_beta,
              hparams.vq_decay,
              hparams.vq_epsilon,
          )
      if hparams.bottleneck_kind == "em":
          return vq_discrete_bottleneck(
              x,
              hparams.bottleneck_bits,
              hparams.vq_beta,
              hparams.vq_decay,
              hparams.vq_epsilon,
              soft_em=True,
              num_samples=hparams.vq_num_samples,
          )
      if hparams.bottleneck_kind == "gumbel_softmax":
          return gumbel_softmax_discrete_bottleneck(
              x,
              hparams.bottleneck_bits,
              hparams.vq_beta,
              hparams.vq_decay,
              hparams.vq_epsilon,
              hparams.temperature_warmup_steps,
              hard=False,
              summary=True,
          )
  
      raise ValueError(
          "Unsupported hparams.bottleneck_kind %s"
          % hparams.bottleneck_kind
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from functools import partial
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_image_attention
  from tensor2tensor.layers import common_layers
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tensorflow_probability
  from tensorflow.python.training import moving_averages
label_desc: Use image node_id 27 for calling a global function with example usage: parametrized_bottleneck(x, hparams) and returns: d,  int, isemhash_bottleneck, vq_discrete_bottleneck, vq_discrete_bottleneck, gumbel_softmax_discrete_bottleneck