diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2016-11-09 14:26:12 -0800 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2016-11-09 14:43:13 -0800 |
commit | 96b6ac340e52a6496a87a05c81d31ddac5ceeb8c (patch) | |
tree | 30c2fe808f239d122e3b301e6de69d405ddcecdd | |
parent | e8ba1356cbbff8c572c6cc614297540185699b20 (diff) |
Update generated Python Op docs.
Change: 138685441
5 files changed, 622 insertions, 80 deletions
diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.summary.FileWriter.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.summary.FileWriter.md new file mode 100644 index 0000000000..1ecf1822c9 --- /dev/null +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.summary.FileWriter.md @@ -0,0 +1,191 @@ +Writes `Summary` protocol buffers to event files. + +The `FileWriter` class provides a mechanism to create an event file in a +given directory and add summaries and events to it. The class updates the +file contents asynchronously. This allows a training program to call methods +to add data to the file directly from the training loop, without slowing down +training. + +- - - + +#### `tf.summary.FileWriter.__init__(logdir, graph=None, max_queue=10, flush_secs=120, graph_def=None)` {#FileWriter.__init__} + +Creates a `FileWriter` and an event file. + +On construction the summary writer creates a new event file in `logdir`. +This event file will contain `Event` protocol buffers constructed when you +call one of the following functions: `add_summary()`, `add_session_log()`, +`add_event()`, or `add_graph()`. + +If you pass a `Graph` to the constructor it is added to +the event file. (This is equivalent to calling `add_graph()` later). + +TensorBoard will pick the graph from the file and display it graphically so +you can interactively explore the graph you built. You will usually pass +the graph from the session in which you launched it: + +```python +...create a graph... +# Launch the graph in a session. +sess = tf.Session() +# Create a summary writer, add the 'graph' to the event file. +writer = tf.train.SummaryWriter(<some-directory>, sess.graph) +``` + +The other arguments to the constructor control the asynchronous writes to +the event file: + +* `flush_secs`: How often, in seconds, to flush the added summaries + and events to disk. +* `max_queue`: Maximum number of summaries or events pending to be + written to disk before one of the 'add' calls block. + +##### Args: + + +* <b>`logdir`</b>: A string. Directory where event file will be written. +* <b>`graph`</b>: A `Graph` object, such as `sess.graph`. +* <b>`max_queue`</b>: Integer. Size of the queue for pending events and summaries. +* <b>`flush_secs`</b>: Number. How often, in seconds, to flush the + pending events and summaries to disk. +* <b>`graph_def`</b>: DEPRECATED: Use the `graph` argument instead. + + + +- - - + +#### `tf.summary.FileWriter.add_summary(summary, global_step=None)` {#FileWriter.add_summary} + +Adds a `Summary` protocol buffer to the event file. + +This method wraps the provided summary in an `Event` protocol buffer +and adds it to the event file. + +You can pass the result of evaluating any summary op, using +[`Session.run()`](client.md#Session.run) or +[`Tensor.eval()`](framework.md#Tensor.eval), to this +function. Alternatively, you can pass a `tf.Summary` protocol +buffer that you populate with your own data. The latter is +commonly done to report evaluation results in event files. + +##### Args: + + +* <b>`summary`</b>: A `Summary` protocol buffer, optionally serialized as a string. +* <b>`global_step`</b>: Number. Optional global step value to record with the + summary. + + +- - - + +#### `tf.summary.FileWriter.add_session_log(session_log, global_step=None)` {#FileWriter.add_session_log} + +Adds a `SessionLog` protocol buffer to the event file. + +This method wraps the provided session in an `Event` protocol buffer +and adds it to the event file. + +##### Args: + + +* <b>`session_log`</b>: A `SessionLog` protocol buffer. +* <b>`global_step`</b>: Number. Optional global step value to record with the + summary. + + +- - - + +#### `tf.summary.FileWriter.add_event(event)` {#FileWriter.add_event} + +Adds an event to the event file. + +##### Args: + + +* <b>`event`</b>: An `Event` protocol buffer. + + +- - - + +#### `tf.summary.FileWriter.add_graph(graph, global_step=None, graph_def=None)` {#FileWriter.add_graph} + +Adds a `Graph` to the event file. + +The graph described by the protocol buffer will be displayed by +TensorBoard. Most users pass a graph in the constructor instead. + +##### Args: + + +* <b>`graph`</b>: A `Graph` object, such as `sess.graph`. +* <b>`global_step`</b>: Number. Optional global step counter to record with the + graph. +* <b>`graph_def`</b>: DEPRECATED. Use the `graph` parameter instead. + +##### Raises: + + +* <b>`ValueError`</b>: If both graph and graph_def are passed to the method. + + +- - - + +#### `tf.summary.FileWriter.add_run_metadata(run_metadata, tag, global_step=None)` {#FileWriter.add_run_metadata} + +Adds a metadata information for a single session.run() call. + +##### Args: + + +* <b>`run_metadata`</b>: A `RunMetadata` protobuf object. +* <b>`tag`</b>: The tag name for this metadata. +* <b>`global_step`</b>: Number. Optional global step counter to record with the + StepStats. + +##### Raises: + + +* <b>`ValueError`</b>: If the provided tag was already used for this type of event. + + +- - - + +#### `tf.summary.FileWriter.get_logdir()` {#FileWriter.get_logdir} + +Returns the directory where event file will be written. + + + +- - - + +#### `tf.summary.FileWriter.flush()` {#FileWriter.flush} + +Flushes the event file to disk. + +Call this method to make sure that all pending events have been written to +disk. + + +- - - + +#### `tf.summary.FileWriter.close()` {#FileWriter.close} + +Flushes the event file to disk and close the file. + +Call this method when you do not need the summary writer anymore. + + + +#### Other Methods +- - - + +#### `tf.summary.FileWriter.reopen()` {#FileWriter.reopen} + +Reopens the EventFileWriter. + +Can be called after `close()` to add more events in the same directory. +The events will go into a new events file. + +Does nothing if the EventFileWriter was not closed. + + diff --git a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.train.SummaryWriter.md b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.train.SummaryWriter.md index 1654cde050..cb96358aa1 100644 --- a/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.train.SummaryWriter.md +++ b/tensorflow/g3doc/api_docs/python/functions_and_classes/shard7/tf.train.SummaryWriter.md @@ -1,55 +1,131 @@ -Exact match for the pre-1.0 tf.train.SummaryWriter. +Writes `Summary` protocol buffers to event files. + +The `FileWriter` class provides a mechanism to create an event file in a +given directory and add summaries and events to it. The class updates the +file contents asynchronously. This allows a training program to call methods +to add data to the file directly from the training loop, without slowing down +training. + - - - #### `tf.train.SummaryWriter.__init__(logdir, graph=None, max_queue=10, flush_secs=120, graph_def=None)` {#SummaryWriter.__init__} +Creates a `FileWriter` and an event file. +On construction the summary writer creates a new event file in `logdir`. +This event file will contain `Event` protocol buffers constructed when you +call one of the following functions: `add_summary()`, `add_session_log()`, +`add_event()`, or `add_graph()`. +If you pass a `Graph` to the constructor it is added to +the event file. (This is equivalent to calling `add_graph()` later). -- - - +TensorBoard will pick the graph from the file and display it graphically so +you can interactively explore the graph you built. You will usually pass +the graph from the session in which you launched it: -#### `tf.train.SummaryWriter.add_graph(graph, global_step=None, graph_def=None)` {#SummaryWriter.add_graph} +```python +...create a graph... +# Launch the graph in a session. +sess = tf.Session() +# Create a summary writer, add the 'graph' to the event file. +writer = tf.train.SummaryWriter(<some-directory>, sess.graph) +``` -Adds a `Graph` to the event file. +The other arguments to the constructor control the asynchronous writes to +the event file: -The graph described by the protocol buffer will be displayed by -TensorBoard. Most users pass a graph in the constructor instead. +* `flush_secs`: How often, in seconds, to flush the added summaries + and events to disk. +* `max_queue`: Maximum number of summaries or events pending to be + written to disk before one of the 'add' calls block. ##### Args: +* <b>`logdir`</b>: A string. Directory where event file will be written. * <b>`graph`</b>: A `Graph` object, such as `sess.graph`. -* <b>`global_step`</b>: Number. Optional global step counter to record with the - graph. -* <b>`graph_def`</b>: DEPRECATED. Use the `graph` parameter instead. +* <b>`max_queue`</b>: Integer. Size of the queue for pending events and summaries. +* <b>`flush_secs`</b>: Number. How often, in seconds, to flush the + pending events and summaries to disk. +* <b>`graph_def`</b>: DEPRECATED: Use the `graph` argument instead. -##### Raises: -* <b>`ValueError`</b>: If both graph and graph_def are passed to the method. +- - - + +#### `tf.train.SummaryWriter.add_summary(summary, global_step=None)` {#SummaryWriter.add_summary} + +Adds a `Summary` protocol buffer to the event file. + +This method wraps the provided summary in an `Event` protocol buffer +and adds it to the event file. + +You can pass the result of evaluating any summary op, using +[`Session.run()`](client.md#Session.run) or +[`Tensor.eval()`](framework.md#Tensor.eval), to this +function. Alternatively, you can pass a `tf.Summary` protocol +buffer that you populate with your own data. The latter is +commonly done to report evaluation results in event files. + +##### Args: + + +* <b>`summary`</b>: A `Summary` protocol buffer, optionally serialized as a string. +* <b>`global_step`</b>: Number. Optional global step value to record with the + summary. + + +- - - + +#### `tf.train.SummaryWriter.add_session_log(session_log, global_step=None)` {#SummaryWriter.add_session_log} + +Adds a `SessionLog` protocol buffer to the event file. + +This method wraps the provided session in an `Event` protocol buffer +and adds it to the event file. + +##### Args: + + +* <b>`session_log`</b>: A `SessionLog` protocol buffer. +* <b>`global_step`</b>: Number. Optional global step value to record with the + summary. + + +- - - + +#### `tf.train.SummaryWriter.add_event(event)` {#SummaryWriter.add_event} + +Adds an event to the event file. + +##### Args: + + +* <b>`event`</b>: An `Event` protocol buffer. - - - -#### `tf.train.SummaryWriter.add_meta_graph(meta_graph_def, global_step=None)` {#SummaryWriter.add_meta_graph} +#### `tf.train.SummaryWriter.add_graph(graph, global_step=None, graph_def=None)` {#SummaryWriter.add_graph} -Adds a `MetaGraphDef` to the event file. +Adds a `Graph` to the event file. -The `MetaGraphDef` allows running the given graph via -`saver.import_meta_graph()`. +The graph described by the protocol buffer will be displayed by +TensorBoard. Most users pass a graph in the constructor instead. ##### Args: -* <b>`meta_graph_def`</b>: A `MetaGraphDef` object, often as retured by - `saver.export_meta_graph()`. +* <b>`graph`</b>: A `Graph` object, such as `sess.graph`. * <b>`global_step`</b>: Number. Optional global step counter to record with the graph. +* <b>`graph_def`</b>: DEPRECATED. Use the `graph` parameter instead. ##### Raises: -* <b>`TypeError`</b>: If both `meta_graph_def` is not an instance of `MetaGraphDef`. +* <b>`ValueError`</b>: If both graph and graph_def are passed to the method. - - - @@ -74,42 +150,42 @@ Adds a metadata information for a single session.run() call. - - - -#### `tf.train.SummaryWriter.add_session_log(session_log, global_step=None)` {#SummaryWriter.add_session_log} +#### `tf.train.SummaryWriter.get_logdir()` {#SummaryWriter.get_logdir} -Adds a `SessionLog` protocol buffer to the event file. +Returns the directory where event file will be written. -This method wraps the provided session in an `Event` protocol buffer -and adds it to the event file. -##### Args: +- - - -* <b>`session_log`</b>: A `SessionLog` protocol buffer. -* <b>`global_step`</b>: Number. Optional global step value to record with the - summary. +#### `tf.train.SummaryWriter.flush()` {#SummaryWriter.flush} + +Flushes the event file to disk. + +Call this method to make sure that all pending events have been written to +disk. - - - -#### `tf.train.SummaryWriter.add_summary(summary, global_step=None)` {#SummaryWriter.add_summary} +#### `tf.train.SummaryWriter.close()` {#SummaryWriter.close} -Adds a `Summary` protocol buffer to the event file. +Flushes the event file to disk and close the file. -This method wraps the provided summary in an `Event` protocol buffer -and adds it to the event file. +Call this method when you do not need the summary writer anymore. -You can pass the result of evaluating any summary op, using -[`Session.run()`](client.md#Session.run) or -[`Tensor.eval()`](framework.md#Tensor.eval), to this -function. Alternatively, you can pass a `tf.Summary` protocol -buffer that you populate with your own data. The latter is -commonly done to report evaluation results in event files. -##### Args: +#### Other Methods +- - - + +#### `tf.train.SummaryWriter.reopen()` {#SummaryWriter.reopen} -* <b>`summary`</b>: A `Summary` protocol buffer, optionally serialized as a string. -* <b>`global_step`</b>: Number. Optional global step value to record with the - summary. +Reopens the EventFileWriter. + +Can be called after `close()` to add more events in the same directory. +The events will go into a new events file. + +Does nothing if the EventFileWriter was not closed. diff --git a/tensorflow/g3doc/api_docs/python/index.md b/tensorflow/g3doc/api_docs/python/index.md index 20b48e0afa..b9e6d89de1 100644 --- a/tensorflow/g3doc/api_docs/python/index.md +++ b/tensorflow/g3doc/api_docs/python/index.md @@ -667,6 +667,7 @@ * **[Summary Operations](../../api_docs/python/summary.md)**: * [`audio`](../../api_docs/python/summary.md#audio) + * [`FileWriter`](../../api_docs/python/summary.md#FileWriter) * [`get_summary_description`](../../api_docs/python/summary.md#get_summary_description) * [`histogram`](../../api_docs/python/summary.md#histogram) * [`image`](../../api_docs/python/summary.md#image) diff --git a/tensorflow/g3doc/api_docs/python/summary.md b/tensorflow/g3doc/api_docs/python/summary.md index 9a91d81a06..5f7400a6c0 100644 --- a/tensorflow/g3doc/api_docs/python/summary.md +++ b/tensorflow/g3doc/api_docs/python/summary.md @@ -5,6 +5,204 @@ ## Generation of summaries. +### Class for writing Summaries +- - - + +### `class tf.summary.FileWriter` {#FileWriter} + +Writes `Summary` protocol buffers to event files. + +The `FileWriter` class provides a mechanism to create an event file in a +given directory and add summaries and events to it. The class updates the +file contents asynchronously. This allows a training program to call methods +to add data to the file directly from the training loop, without slowing down +training. + +- - - + +#### `tf.summary.FileWriter.__init__(logdir, graph=None, max_queue=10, flush_secs=120, graph_def=None)` {#FileWriter.__init__} + +Creates a `FileWriter` and an event file. + +On construction the summary writer creates a new event file in `logdir`. +This event file will contain `Event` protocol buffers constructed when you +call one of the following functions: `add_summary()`, `add_session_log()`, +`add_event()`, or `add_graph()`. + +If you pass a `Graph` to the constructor it is added to +the event file. (This is equivalent to calling `add_graph()` later). + +TensorBoard will pick the graph from the file and display it graphically so +you can interactively explore the graph you built. You will usually pass +the graph from the session in which you launched it: + +```python +...create a graph... +# Launch the graph in a session. +sess = tf.Session() +# Create a summary writer, add the 'graph' to the event file. +writer = tf.train.SummaryWriter(<some-directory>, sess.graph) +``` + +The other arguments to the constructor control the asynchronous writes to +the event file: + +* `flush_secs`: How often, in seconds, to flush the added summaries + and events to disk. +* `max_queue`: Maximum number of summaries or events pending to be + written to disk before one of the 'add' calls block. + +##### Args: + + +* <b>`logdir`</b>: A string. Directory where event file will be written. +* <b>`graph`</b>: A `Graph` object, such as `sess.graph`. +* <b>`max_queue`</b>: Integer. Size of the queue for pending events and summaries. +* <b>`flush_secs`</b>: Number. How often, in seconds, to flush the + pending events and summaries to disk. +* <b>`graph_def`</b>: DEPRECATED: Use the `graph` argument instead. + + + +- - - + +#### `tf.summary.FileWriter.add_summary(summary, global_step=None)` {#FileWriter.add_summary} + +Adds a `Summary` protocol buffer to the event file. + +This method wraps the provided summary in an `Event` protocol buffer +and adds it to the event file. + +You can pass the result of evaluating any summary op, using +[`Session.run()`](client.md#Session.run) or +[`Tensor.eval()`](framework.md#Tensor.eval), to this +function. Alternatively, you can pass a `tf.Summary` protocol +buffer that you populate with your own data. The latter is +commonly done to report evaluation results in event files. + +##### Args: + + +* <b>`summary`</b>: A `Summary` protocol buffer, optionally serialized as a string. +* <b>`global_step`</b>: Number. Optional global step value to record with the + summary. + + +- - - + +#### `tf.summary.FileWriter.add_session_log(session_log, global_step=None)` {#FileWriter.add_session_log} + +Adds a `SessionLog` protocol buffer to the event file. + +This method wraps the provided session in an `Event` protocol buffer +and adds it to the event file. + +##### Args: + + +* <b>`session_log`</b>: A `SessionLog` protocol buffer. +* <b>`global_step`</b>: Number. Optional global step value to record with the + summary. + + +- - - + +#### `tf.summary.FileWriter.add_event(event)` {#FileWriter.add_event} + +Adds an event to the event file. + +##### Args: + + +* <b>`event`</b>: An `Event` protocol buffer. + + +- - - + +#### `tf.summary.FileWriter.add_graph(graph, global_step=None, graph_def=None)` {#FileWriter.add_graph} + +Adds a `Graph` to the event file. + +The graph described by the protocol buffer will be displayed by +TensorBoard. Most users pass a graph in the constructor instead. + +##### Args: + + +* <b>`graph`</b>: A `Graph` object, such as `sess.graph`. +* <b>`global_step`</b>: Number. Optional global step counter to record with the + graph. +* <b>`graph_def`</b>: DEPRECATED. Use the `graph` parameter instead. + +##### Raises: + + +* <b>`ValueError`</b>: If both graph and graph_def are passed to the method. + + +- - - + +#### `tf.summary.FileWriter.add_run_metadata(run_metadata, tag, global_step=None)` {#FileWriter.add_run_metadata} + +Adds a metadata information for a single session.run() call. + +##### Args: + + +* <b>`run_metadata`</b>: A `RunMetadata` protobuf object. +* <b>`tag`</b>: The tag name for this metadata. +* <b>`global_step`</b>: Number. Optional global step counter to record with the + StepStats. + +##### Raises: + + +* <b>`ValueError`</b>: If the provided tag was already used for this type of event. + + +- - - + +#### `tf.summary.FileWriter.get_logdir()` {#FileWriter.get_logdir} + +Returns the directory where event file will be written. + + + +- - - + +#### `tf.summary.FileWriter.flush()` {#FileWriter.flush} + +Flushes the event file to disk. + +Call this method to make sure that all pending events have been written to +disk. + + +- - - + +#### `tf.summary.FileWriter.close()` {#FileWriter.close} + +Flushes the event file to disk and close the file. + +Call this method when you do not need the summary writer anymore. + + + +#### Other Methods +- - - + +#### `tf.summary.FileWriter.reopen()` {#FileWriter.reopen} + +Reopens the EventFileWriter. + +Can be called after `close()` to add more events in the same directory. +The events will go into a new events file. + +Does nothing if the EventFileWriter was not closed. + + + + ### Summary Ops - - - diff --git a/tensorflow/g3doc/api_docs/python/train.md b/tensorflow/g3doc/api_docs/python/train.md index 9249176440..f82fea5c3e 100644 --- a/tensorflow/g3doc/api_docs/python/train.md +++ b/tensorflow/g3doc/api_docs/python/train.md @@ -4105,58 +4105,134 @@ overview of summaries, event files, and visualization in TensorBoard. ### `class tf.train.SummaryWriter` {#SummaryWriter} -Exact match for the pre-1.0 tf.train.SummaryWriter. +Writes `Summary` protocol buffers to event files. + +The `FileWriter` class provides a mechanism to create an event file in a +given directory and add summaries and events to it. The class updates the +file contents asynchronously. This allows a training program to call methods +to add data to the file directly from the training loop, without slowing down +training. + - - - #### `tf.train.SummaryWriter.__init__(logdir, graph=None, max_queue=10, flush_secs=120, graph_def=None)` {#SummaryWriter.__init__} +Creates a `FileWriter` and an event file. +On construction the summary writer creates a new event file in `logdir`. +This event file will contain `Event` protocol buffers constructed when you +call one of the following functions: `add_summary()`, `add_session_log()`, +`add_event()`, or `add_graph()`. +If you pass a `Graph` to the constructor it is added to +the event file. (This is equivalent to calling `add_graph()` later). -- - - +TensorBoard will pick the graph from the file and display it graphically so +you can interactively explore the graph you built. You will usually pass +the graph from the session in which you launched it: -#### `tf.train.SummaryWriter.add_graph(graph, global_step=None, graph_def=None)` {#SummaryWriter.add_graph} +```python +...create a graph... +# Launch the graph in a session. +sess = tf.Session() +# Create a summary writer, add the 'graph' to the event file. +writer = tf.train.SummaryWriter(<some-directory>, sess.graph) +``` -Adds a `Graph` to the event file. +The other arguments to the constructor control the asynchronous writes to +the event file: -The graph described by the protocol buffer will be displayed by -TensorBoard. Most users pass a graph in the constructor instead. +* `flush_secs`: How often, in seconds, to flush the added summaries + and events to disk. +* `max_queue`: Maximum number of summaries or events pending to be + written to disk before one of the 'add' calls block. ##### Args: +* <b>`logdir`</b>: A string. Directory where event file will be written. * <b>`graph`</b>: A `Graph` object, such as `sess.graph`. -* <b>`global_step`</b>: Number. Optional global step counter to record with the - graph. -* <b>`graph_def`</b>: DEPRECATED. Use the `graph` parameter instead. +* <b>`max_queue`</b>: Integer. Size of the queue for pending events and summaries. +* <b>`flush_secs`</b>: Number. How often, in seconds, to flush the + pending events and summaries to disk. +* <b>`graph_def`</b>: DEPRECATED: Use the `graph` argument instead. -##### Raises: -* <b>`ValueError`</b>: If both graph and graph_def are passed to the method. +- - - + +#### `tf.train.SummaryWriter.add_summary(summary, global_step=None)` {#SummaryWriter.add_summary} + +Adds a `Summary` protocol buffer to the event file. + +This method wraps the provided summary in an `Event` protocol buffer +and adds it to the event file. + +You can pass the result of evaluating any summary op, using +[`Session.run()`](client.md#Session.run) or +[`Tensor.eval()`](framework.md#Tensor.eval), to this +function. Alternatively, you can pass a `tf.Summary` protocol +buffer that you populate with your own data. The latter is +commonly done to report evaluation results in event files. + +##### Args: + + +* <b>`summary`</b>: A `Summary` protocol buffer, optionally serialized as a string. +* <b>`global_step`</b>: Number. Optional global step value to record with the + summary. + + +- - - + +#### `tf.train.SummaryWriter.add_session_log(session_log, global_step=None)` {#SummaryWriter.add_session_log} + +Adds a `SessionLog` protocol buffer to the event file. + +This method wraps the provided session in an `Event` protocol buffer +and adds it to the event file. + +##### Args: + + +* <b>`session_log`</b>: A `SessionLog` protocol buffer. +* <b>`global_step`</b>: Number. Optional global step value to record with the + summary. - - - -#### `tf.train.SummaryWriter.add_meta_graph(meta_graph_def, global_step=None)` {#SummaryWriter.add_meta_graph} +#### `tf.train.SummaryWriter.add_event(event)` {#SummaryWriter.add_event} + +Adds an event to the event file. + +##### Args: -Adds a `MetaGraphDef` to the event file. -The `MetaGraphDef` allows running the given graph via -`saver.import_meta_graph()`. +* <b>`event`</b>: An `Event` protocol buffer. + + +- - - + +#### `tf.train.SummaryWriter.add_graph(graph, global_step=None, graph_def=None)` {#SummaryWriter.add_graph} + +Adds a `Graph` to the event file. + +The graph described by the protocol buffer will be displayed by +TensorBoard. Most users pass a graph in the constructor instead. ##### Args: -* <b>`meta_graph_def`</b>: A `MetaGraphDef` object, often as retured by - `saver.export_meta_graph()`. +* <b>`graph`</b>: A `Graph` object, such as `sess.graph`. * <b>`global_step`</b>: Number. Optional global step counter to record with the graph. +* <b>`graph_def`</b>: DEPRECATED. Use the `graph` parameter instead. ##### Raises: -* <b>`TypeError`</b>: If both `meta_graph_def` is not an instance of `MetaGraphDef`. +* <b>`ValueError`</b>: If both graph and graph_def are passed to the method. - - - @@ -4181,43 +4257,43 @@ Adds a metadata information for a single session.run() call. - - - -#### `tf.train.SummaryWriter.add_session_log(session_log, global_step=None)` {#SummaryWriter.add_session_log} +#### `tf.train.SummaryWriter.get_logdir()` {#SummaryWriter.get_logdir} -Adds a `SessionLog` protocol buffer to the event file. +Returns the directory where event file will be written. -This method wraps the provided session in an `Event` protocol buffer -and adds it to the event file. -##### Args: +- - - -* <b>`session_log`</b>: A `SessionLog` protocol buffer. -* <b>`global_step`</b>: Number. Optional global step value to record with the - summary. +#### `tf.train.SummaryWriter.flush()` {#SummaryWriter.flush} + +Flushes the event file to disk. + +Call this method to make sure that all pending events have been written to +disk. - - - -#### `tf.train.SummaryWriter.add_summary(summary, global_step=None)` {#SummaryWriter.add_summary} +#### `tf.train.SummaryWriter.close()` {#SummaryWriter.close} -Adds a `Summary` protocol buffer to the event file. +Flushes the event file to disk and close the file. -This method wraps the provided summary in an `Event` protocol buffer -and adds it to the event file. +Call this method when you do not need the summary writer anymore. -You can pass the result of evaluating any summary op, using -[`Session.run()`](client.md#Session.run) or -[`Tensor.eval()`](framework.md#Tensor.eval), to this -function. Alternatively, you can pass a `tf.Summary` protocol -buffer that you populate with your own data. The latter is -commonly done to report evaluation results in event files. -##### Args: +#### Other Methods +- - - + +#### `tf.train.SummaryWriter.reopen()` {#SummaryWriter.reopen} -* <b>`summary`</b>: A `Summary` protocol buffer, optionally serialized as a string. -* <b>`global_step`</b>: Number. Optional global step value to record with the - summary. +Reopens the EventFileWriter. + +Can be called after `close()` to add more events in the same directory. +The events will go into a new events file. + +Does nothing if the EventFileWriter was not closed. |