def testConstruction(self):
    with self.session():
      p = self._testParams()
      mdl = p.Instantiate()
      flatten_vars = mdl.vars.Flatten()
      print('vars flattened = ', flatten_vars)
      # encoder: 91 (1 + 36 + 54)
      # encoder/embedding: 1
      # encoder/ff_layer: 6 * 6
      # encoder/attention: 9 * 6
      # decoder: 12 (1 + 3 + 6 + 2)
      # decoder/embedding: 1
      # decoder/atten: 3
      # decoder/lstms: 2 * 3
      # decoder/softmax: 2
      self.assertEqual(len(flatten_vars), 91 + 12)

      # Should match tf.trainable_variables().
      self.assertEqual(len(tf.trainable_variables()), len(flatten_vars))