class_docstr: Test that Tensorboard summaries get written correctly.
docstr: Tests that summaries are written to candidate directory.
docstr_tok: ["Tests","that","summaries","are","written","to","candidate","directory","."]
code: def test_summaries(self):
      """Tests that summaries are written to candidate directory."""
  
      run_config = tf.estimator.RunConfig(
          tf_random_seed=42,
          log_step_count_steps=2,
          save_summary_steps=2,
          model_dir=self.test_subdirectory,
      )
      subnetwork_generator = SimpleGenerator([_SimpleBuilder("dnn")])
      report_materializer = ReportMaterializer(
          input_fn=tu.dummy_input_fn([[1.0, 1.0]], [[0.0]]), steps=1
      )
      estimator = Estimator(
          head=regression_head.RegressionHead(
              loss_reduction=tf_compat.SUM_OVER_BATCH_SIZE
          ),
          subnetwork_generator=subnetwork_generator,
          report_materializer=report_materializer,
          max_iteration_steps=10,
          config=run_config,
      )
      train_input_fn = tu.dummy_input_fn([[1.0, 0.0]], [[1.0]])
      estimator.train(input_fn=train_input_fn, max_steps=3)
  
      ensemble_loss = 1.52950
      self.assertAlmostEqual(
          ensemble_loss,
          tu.check_eventfile_for_keyword(
              "loss", self.test_subdirectory
          ),
          places=3,
      )
      self.assertIsNotNone(
          tu.check_eventfile_for_keyword(
              "global_step/sec", self.test_subdirectory
          )
      )
      self.assertEqual(
          0.0,
          tu.check_eventfile_for_keyword(
              "iteration/adanet/iteration", self.test_subdirectory
          ),
      )
  
      subnetwork_subdir = os.path.join(
          self.test_subdirectory, "subnetwork/t0_dnn"
      )
      self.assertAlmostEqual(
          3.0,
          tu.check_eventfile_for_keyword("scalar", subnetwork_subdir),
          places=3,
      )
      self.assertEqual(
          (3, 3, 1),
          tu.check_eventfile_for_keyword("image", subnetwork_subdir),
      )
      self.assertAlmostEqual(
          5.0,
          tu.check_eventfile_for_keyword(
              "nested/scalar", subnetwork_subdir
          ),
          places=3,
      )
  
      ensemble_subdir = os.path.join(
          self.test_subdirectory,
          "ensemble/t0_dnn_grow_complexity_regularized",
      )
      self.assertAlmostEqual(
          ensemble_loss,
          tu.check_eventfile_for_keyword(
              "adanet_loss/adanet/adanet_weighted_ensemble",
              ensemble_subdir,
          ),
          places=1,
      )
      self.assertAlmostEqual(
          0.0,
          tu.check_eventfile_for_keyword(
              "complexity_regularization/adanet/adanet_weighted_ensemble",
              ensemble_subdir,
          ),
          places=3,
      )
      self.assertAlmostEqual(
          1.0,
          tu.check_eventfile_for_keyword(
              "mixture_weight_norms/adanet/"
              "adanet_weighted_ensemble/subnetwork_0",
              ensemble_subdir,
          ),
          places=3,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import os
  from absl import logging
  from adanet import tf_compat
  from adanet.core import testing_utils
  from adanet.core.estimator import Estimator
  from adanet.core.report_materializer import ReportMaterializer
  from adanet.subnetwork import Builder
  from adanet.subnetwork import SimpleGenerator
  from adanet.subnetwork import Subnetwork
  import tensorflow.compat.v2
  from tensorflow_estimator.python.estimator.head import regression_head
label_desc: Use image node_id 1 for calling the EstimatorSummaryWriterTest obj's underlying member method code with example usage: obj.test_summaries() without return types