Returns a serialized `GraphDef` representation of this graph. The serialized `GraphDef` can be imported into another `Graph` (using `tf.import_graph_def`) or used with the [C++ Session API](../../api_docs/cc/index.md). This method is thread-safe. Args: from_version: Opti
(self, from_version=None, add_shapes=False)
| 3214 | return graph, self._version |
| 3215 | |
| 3216 | def as_graph_def(self, from_version=None, add_shapes=False): |
| 3217 | # pylint: disable=line-too-long |
| 3218 | """Returns a serialized `GraphDef` representation of this graph. |
| 3219 | |
| 3220 | The serialized `GraphDef` can be imported into another `Graph` |
| 3221 | (using `tf.import_graph_def`) or used with the |
| 3222 | [C++ Session API](../../api_docs/cc/index.md). |
| 3223 | |
| 3224 | This method is thread-safe. |
| 3225 | |
| 3226 | Args: |
| 3227 | from_version: Optional. If this is set, returns a `GraphDef` containing |
| 3228 | only the nodes that were added to this graph since its `version` |
| 3229 | property had the given value. |
| 3230 | add_shapes: If true, adds an "_output_shapes" list attr to each node with |
| 3231 | the inferred shapes of each of its outputs. |
| 3232 | |
| 3233 | Returns: |
| 3234 | A |
| 3235 | [`GraphDef`](https://www.tensorflow.org/code/tensorflow/core/framework/graph.proto) |
| 3236 | protocol buffer. |
| 3237 | |
| 3238 | Raises: |
| 3239 | ValueError: If the `graph_def` would be too large. |
| 3240 | """ |
| 3241 | # pylint: enable=line-too-long |
| 3242 | result, _ = self._as_graph_def(from_version, add_shapes) |
| 3243 | return result |
| 3244 | |
| 3245 | def _is_function(self, name): |
| 3246 | """Tests whether 'name' is registered in this graph's function library. |