code: def update_hparams_for_vq_gating(hparams):
      """VQ Gating hparams."""
      hparams.add_hparam("z_size", 4)
      hparams.add_hparam("noise_dev", 0.5)
      # Bottleneck kinds supported: dense, vae, dvq.
      hparams.add_hparam("bottleneck_kind", "dvq")
      hparams.add_hparam("num_blocks", 1)
      hparams.add_hparam("num_residuals", 1)
      # Reshape method for DVQ: slice, project
      hparams.add_hparam("beta", 0.25)
      hparams.add_hparam("epsilon", 1e-5)
      hparams.add_hparam("decay", 0.999)
      hparams.add_hparam(
          "ema", False
      )  # default is false until ema is implemented
      hparams.add_hparam("random_top_k", 1)
      hparams.add_hparam("soft_em", False)
      hparams.add_hparam("num_samples", 10)
      hparams.add_hparam("gating_type", "vq")
      hparams.add_hparam("use_scales", int(True))
      hparams.add_hparam("residual_centroids", int(False))
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import functools
  import math
  import six
  from six.moves import range
  from six.moves import zip
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers.vq_discrete import DiscreteBottleneck
  import tensorflow.compat.v1
label_desc: Use image node_id 10 for calling a global function with example usage: update_hparams_for_vq_gating(hparams) without return types