class_docstr: Test class for the individual model components.
class_docstr_tok: ["Test","class","for","the","individual","model","components","."]
code: def testLearnableMultivariateNormalDiagCellClassNoBatch(self):
      prior = disentangled_vae.LearnableMultivariateNormalDiagCell(
          self.dimensions, self.hidden_size
      )
  
      # Zero state.
      dynamic_previous_output, state = prior.zero_state()
      self.assertEqual(
          dynamic_previous_output.shape, (self.dimensions,)
      )
      for tensor in state:
          self.assertEqual(tensor.shape, (1, self.hidden_size))
      h0, c0 = state
  
      # First timestep.
      dist_z1, state_z1 = prior(dynamic_previous_output, state)
      self.assertDistShape(dist_z1, (self.dimensions,), ())
      for tensor in state_z1:
          self.assertEqual(tensor.shape, (1, self.hidden_size))
      if not tf.executing_eagerly():
          self.evaluate(tf.compat.v1.global_variables_initializer())
      h1, c1 = state_z1
      self.assertTrue(np.allclose(self.evaluate(h1), self.evaluate(h0)))
      self.assertTrue(np.allclose(self.evaluate(c1), self.evaluate(c0)))
  
      # Second timestep.
      dist_z2, state = prior(dist_z1.sample(), state_z1)
      self.assertDistShape(dist_z2, (self.dimensions,), ())
      for tensor in state:
          self.assertEqual(tensor.shape, (1, self.hidden_size))
      h2, c2 = state
      self.assertFalse(
          np.allclose(self.evaluate(h2), self.evaluate(h1))
      )
      self.assertFalse(
          np.allclose(self.evaluate(c2), self.evaluate(c1))
      )
  
      # Second timestep with sample shape.
      dist_z2, state = prior(dist_z1.sample(2), state_z1)
      self.assertDistShape(dist_z2, (self.dimensions,), (2))
      for tensor in state:
          self.assertEqual(tensor.shape, (2, self.hidden_size))
  
imports: import numpy
  import tensorflow.compat.v1
  from tensorflow_probability.examples import disentangled_vae
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 2 for calling the DisentangledVAEComponentsTest obj's underlying member method code with example usage: obj.testLearnableMultivariateNormalDiagCellClassNoBatch() without return types