import tensorflow as tf

    p.decoder.target_seq_len = 5
    p.encoder.input_shape = input_shape
    p.input = tig.TestInputGenerator.Params()
    p.input.target_max_length = 5
    p.input.source_shape = input_shape
    p.input.target_shape = [2, 5]
    p.name = 'test_mdl'
    return p

  def testMakeDecoderTheta(self):
    # Test that decoder theta returns a copy of theta.decoder without changes.
    with self.session(use_gpu=False, graph=tf.Graph()):
      tf.set_random_seed(93820985)
      p = self._testParams()
      mdl = p.Instantiate()
      mdl.FPropDefaultTheta()
      decoder_theta = mdl._MakeDecoderTheta(theta=mdl.theta, input_batch=None)
      mdl.BProp()
      self.assertEqual(decoder_theta, mdl.theta.decoder)

  def testFProp(self):
    with self.session(use_gpu=False):
      tf.set_random_seed(93820985)
      p = self._testParams()
