code: def gen_make_hmc_kernel_fn(num_leapfrog_steps=10):
      """Generate a transformed hmc kernel."""
  
      def make_hmc_kernel_fn(target_log_prob_fn, init_state, scalings):
          """Generate a hmc without transformation kernel."""
  
          with tf.name_scope("make_hmc_kernel_fn"):
              state_std = [
                  tf.math.reduce_std(x, axis=0, keepdims=True)
                  for x in init_state
              ]
              step_size = compute_hmc_step_size(
                  scalings, state_std, num_leapfrog_steps
              )
              return hmc.HamiltonianMonteCarlo(
                  target_log_prob_fn=target_log_prob_fn,
                  num_leapfrog_steps=num_leapfrog_steps,
                  step_size=step_size,
              )
  
      return make_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 6 for calling a global function with example usage: gen_make_hmc_kernel_fn(num_leapfrog_steps) and returns: make_hmc_kernel_fn, hmc