docstr: Structural test to make sure Estimator Builder works.
docstr_tok: ["Structural","test","to","make","sure","Estimator","Builder","works","."]
code: def test_estimator(self, hparams_string, batch_size=1):
      """Structural test to make sure Estimator Builder works."""
  
      seed = 42
  
      # Set up and clean test directory.
      model_dir = os.path.join(
          flags.FLAGS.test_tmpdir, "AdanetImproveNasBuilderTest"
      )
      if tf.gfile.Exists(model_dir):
          tf.gfile.DeleteRecursively(model_dir)
      tf.gfile.MkDir(model_dir)
  
      data_provider = fake_data.FakeImageProvider(seed=seed)
      estimator_builder = adanet_improve_nas.Builder()
      hparams = estimator_builder.hparams(
          default_batch_size=3, hparams_string=hparams_string
      )
      run_config = tf.estimator.RunConfig(
          tf_random_seed=seed, model_dir=model_dir
      )
      _ = data_provider.get_input_fn(
          "train", tf.estimator.ModeKeys.TRAIN, batch_size=batch_size
      )
      test_input_fn = data_provider.get_input_fn(
          "test", tf.estimator.ModeKeys.EVAL, batch_size=batch_size
      )
  
      estimator = estimator_builder.estimator(
          data_provider=data_provider,
          run_config=run_config,
          hparams=hparams,
          train_steps=10,
          seed=seed,
      )
      eval_metrics = estimator.evaluate(input_fn=test_input_fn, steps=1)
  
      self.assertGreater(eval_metrics["loss"], 0.0)
  
file_path: adanet/research/improve_nas/trainer/adanet_improve_nas_test.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl import flags
  from absl.testing import parameterized
  from adanet.research.improve_nas.trainer import adanet_improve_nas
  from adanet.research.improve_nas.trainer import fake_data
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling the AdaNetQuetzalBuilderTest obj's underlying member method code with example usage: obj.test_estimator(hparams_string, batch_size) without return types