class_docstr: Tests `TrainSampleHook` class.
    
class_docstr_tok: ["Tests","`","TrainSampleHook","`","class","."]
code: def setUp(self):
      super(TestTrainSampleHook, self).setUp()
      self.model_dir = tempfile.mkdtemp()
      self.sample_dir = os.path.join(self.model_dir, "samples")
  
      # The hook expects these collections to be in the graph
      pred_dict = {}
      pred_dict["predicted_tokens"] = tf.constant(
          [["Hello", "World", "笑w"]]
      )
      pred_dict["labels.target_tokens"] = tf.constant(
          [["Hello", "World", "笑w"]]
      )
      pred_dict["labels.target_len"] = (tf.constant(2),)
      graph_utils.add_dict_to_collection(pred_dict, "predictions")
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import os
  import tempfile
  import shutil
  import time
  import tensorflow
  from tensorflow.python.training import monitored_session
  from tensorflow import gfile
  from seq2seq import graph_utils
  from seq2seq.training import hooks
label_desc: Use image node_id 1 for calling the TestTrainSampleHook obj's underlying member method code with example usage: obj.setUp() without return types