code: def testCreateHparams(self):
      # Get json_path
      pkg = os.path.abspath(__file__)
      pkg, _ = os.path.split(pkg)
      pkg, _ = os.path.split(pkg)
      json_path = os.path.join(
          pkg, "test_data", "transformer_test_ckpt", "hparams.json"
      )
  
      # Create hparams
      hparams = trainer_lib.create_hparams(
          "transformer_big", "hidden_size=1", hparams_path=json_path
      )
      self.assertEqual(2, hparams.num_hidden_layers)  # from json
      self.assertEqual(
          1, hparams.hidden_size
      )  # from hparams_overrides_str
  
      # Compare with base hparams
      base_hparams = trainer_lib.create_hparams("transformer_big")
      self.assertEqual(
          len(base_hparams.values()), len(hparams.values())
      )
  
file_path: tensor2tensor/tensor2tensor/utils/trainer_lib_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from tensor2tensor.data_generators import algorithmic
  from tensor2tensor.models import transformer
  from tensor2tensor.utils import data_reader
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import trainer_lib
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 6 for calling the TrainerLibTest obj's underlying member method code with example usage: obj.testCreateHparams() without return types