def after_create_session(self, session=None, coord=None):
config_str = config.operative_config_str()<EOL>if not tf.gfile.IsDirectory(self._output_dir):<EOL><INDENT>tf.gfile.MakeDirs(self._output_dir)<EOL><DEDENT>global_step_val = <NUM_LIT:0><EOL>if session is not None:<EOL><INDENT>global_step = tf.train.get_global_step()<EOL>if global_step is not None:<EOL><INDENT>global_step_val = session.run(global_step)<EOL><DEDENT><DEDENT>filename = '<STR_LIT>' % (self._base_name, global_step_val)<EOL>config_path = os.path.join(self._output_dir, filename)<EOL>with tf.gfile.GFile(config_path, '<STR_LIT:w>') as f:<EOL><INDENT>f.write(config_str)<EOL><DEDENT>if self._summarize_config:<EOL><INDENT>md_config_str = self._markdownify_operative_config_str(config_str)<EOL>summary_metadata = summary_pb2.SummaryMetadata()<EOL>summary_metadata.plugin_data.plugin_name = '<STR_LIT:text>'<EOL>summary_metadata.plugin_data.content = b'<STR_LIT:{}>'<EOL>text_tensor = tf.make_tensor_proto(md_config_str)<EOL>summary = summary_pb2.Summary()<EOL>summary.value.add(<EOL>tag='<STR_LIT>' + self._base_name,<EOL>tensor=text_tensor,<EOL>metadata=summary_metadata)<EOL>if not self._summary_writer:<EOL><INDENT>self._summary_writer = tf.summary.FileWriterCache.get(self._output_dir)<EOL><DEDENT>self._summary_writer.add_summary(summary, global_step_val)<EOL>self._summary_writer.flush()<EOL><DEDENT>
Writes out Gin's operative config, and maybe adds a summary of it.