MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / as_graph_def

Method as_graph_def

tensorflow/python/framework/ops.py:3216–3243  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 15

create_test_networkFunction · 0.95
mainFunction · 0.95
_model_graph_defFunction · 0.95
mainFunction · 0.95
testBatchNormScopeMethod · 0.95
_VerifyBuildGraphMethod · 0.95
testNoDeviceMethod · 0.95
testDeviceFullMethod · 0.95
testNestingMethod · 0.95

Calls 1

_as_graph_defMethod · 0.95

Tested by 15

create_test_networkFunction · 0.76
testBatchNormScopeMethod · 0.76
_VerifyBuildGraphMethod · 0.76
testNoDeviceMethod · 0.76
testDeviceFullMethod · 0.76
testNestingMethod · 0.76
testNestingStringMethod · 0.76