import tensorflow as tf

                         "targets": 3}

    problem = ModalityObjProblem(False, False)
    p_hparams = problem.get_hparams()
    self.assertIsInstance(p_hparams.modality["inputs"],
                          modalities.SymbolModality)
    self.assertIsInstance(p_hparams.modality["targets"],
                          modalities.SymbolModality)

  @tf.contrib.eager.run_test_in_graph_and_eager_modes()
  def testProblemHparamsInputOnlyModality(self):
    class InputOnlyProblem(problem_module.Problem):

      def hparams(self, defaults, model_hparams):
        hp = defaults
        hp.modality = {"inputs": modalities.SymbolModality}
        hp.vocab_size = {"inputs": 2}

