code: def testExternalBias(self):
      batch_size = 4
      num_hidden = 6
      num_dims = 8
      test_inputs = tf.random_normal(shape=(batch_size, num_dims))
      test_b_enc = tf.random_normal(shape=(batch_size, num_hidden))
      test_b_dec = tf.random_normal(shape=(batch_size, num_dims))
  
      nade = Nade(num_dims, num_hidden)
      log_prob, cond_probs = nade.log_prob(
          test_inputs, test_b_enc, test_b_dec
      )
      sample, sample_prob = nade.sample(
          b_enc=test_b_enc, b_dec=test_b_dec
      )
      with self.test_session() as sess:
          sess.run([tf.global_variables_initializer()])
          self.assertEqual(log_prob.eval().shape, (batch_size,))
          self.assertEqual(
              cond_probs.eval().shape, (batch_size, num_dims)
          )
          self.assertEqual(sample.eval().shape, (batch_size, num_dims))
          self.assertEqual(sample_prob.eval().shape, (batch_size,))
  
imports: from magenta.common.nade import Nade
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling the NadeTest obj's underlying member method code with example usage: obj.testExternalBias() without return types