code: def gen_make_transform_hmc_kernel_fn(
      unconstraining_bijectors, num_leapfrog_steps=10
  ):
      """Generate a transformed hmc kernel."""
  
      def make_transform_hmc_kernel_fn(
          target_log_prob_fn, init_state, scalings
      ):
          """Generate a transform hmc kernel."""
  
          with tf.name_scope("make_transformed_hmc_kernel_fn"):
              # TransformedTransitionKernel doesn't modify the input step size, thus we
              # need to pass the appropriate step size that are already in unconstrained
              # space
              state_std = [
                  tf.math.reduce_std(
                      bij.inverse(x), axis=0, keepdims=True
                  )
                  for x, bij in zip(
                      init_state, unconstraining_bijectors
                  )
              ]
              step_size = compute_hmc_step_size(
                  scalings, state_std, num_leapfrog_steps
              )
              return transformed_kernel.TransformedTransitionKernel(
                  hmc.HamiltonianMonteCarlo(
                      target_log_prob_fn=target_log_prob_fn,
                      num_leapfrog_steps=num_leapfrog_steps,
                      step_size=step_size,
                  ),
                  unconstraining_bijectors,
              )
  
      return make_transform_hmc_kernel_fn
  
imports: import collections
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.mcmc import weighted_resampling
  from tensorflow_probability.python.internal import broadcast_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.math.generic import log1mexp
  from tensorflow_probability.python.math.generic import log_add_exp
  from tensorflow_probability.python.math.generic import reduce_logmeanexp
  from tensorflow_probability.python.mcmc import hmc
  from tensorflow_probability.python.mcmc import random_walk_metropolis
  from tensorflow_probability.python.mcmc import transformed_kernel
  from tensorflow_probability.python.mcmc.internal import util
label_desc: Use image node_id 5 for calling a global function with example usage: gen_make_transform_hmc_kernel_fn(unconstraining_bijectors, num_leapfrog_steps) and returns: make_transform_hmc_kernel_fn, transformed_kernel