code: def testCallingConventions(self):
      loc = tf.Variable(3.0)
      log_scale = tf.Variable(1.0)
      self.evaluate((loc.initializer, log_scale.initializer))
  
      # Check that we can call the build_fn with positional or named arguments.
      dist_args = deferred_module.DeferredModule(
          _gamma_from_loc_scale, loc, log_scale
      )
      dist_kwargs = deferred_module.DeferredModule(
          _gamma_from_loc_scale, loc=loc, log_scale=log_scale
      )
  
      with tf.GradientTape(persistent=True) as tape:
          mean1, log_stddev1 = dist_args.mean(), tf.math.log(
              dist_args.stddev()
          )
          mean2, log_stddev2 = dist_kwargs.mean(), tf.math.log(
              dist_kwargs.stddev()
          )
      self.assertAllClose(
          self.evaluate(tape.gradient(mean1, [loc, log_scale])),
          [1.0, 0.0],
      )
      self.assertAllClose(
          self.evaluate(tape.gradient(mean2, [loc, log_scale])),
          [1.0, 0.0],
      )
      self.assertAllClose(
          self.evaluate(tape.gradient(log_stddev1, [loc, log_scale])),
          [0.0, 1.0],
      )
      self.assertAllClose(
          self.evaluate(tape.gradient(log_stddev2, [loc, log_scale])),
          [0.0, 1.0],
      )
  
file_path: probability/tensorflow_probability/python/experimental/util/deferred_module_test.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.distributions import normal
  from tensorflow_probability.python.distributions import sample
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.experimental.util import deferred_module
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import test_util
label_desc: Use image node_id 6 for calling the DeferredModuleTest obj's underlying member method code with example usage: obj.testCallingConventions() without return types