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

Method _copy_functions_to_graph_def

tensorflow/python/framework/ops.py:3123–3135  ·  view source on GitHub ↗

If this graph contains functions, copy them to `graph_def`.

(self, graph_def, starting_bytesize)

Source from the content-addressed store, hash-verified

3121 self._control_flow_context = ctx
3122
3123 def _copy_functions_to_graph_def(self, graph_def, starting_bytesize):
3124 """If this graph contains functions, copy them to `graph_def`."""
3125 bytesize = starting_bytesize
3126 for f in self._functions.values():
3127 bytesize += f.definition.ByteSize()
3128 if bytesize >= (1 << 31) or bytesize < 0:
3129 raise ValueError("GraphDef cannot be larger than 2GB.")
3130 graph_def.library.function.extend([f.definition])
3131 if f.grad_func_name:
3132 grad_def = function_pb2.GradientDef()
3133 grad_def.function_name = f.name
3134 grad_def.gradient_func = f.grad_func_name
3135 graph_def.library.gradient.extend([grad_def])
3136
3137 def _as_graph_def(self, from_version=None, add_shapes=False):
3138 # pylint: disable=line-too-long

Callers 2

export_scoped_meta_graphFunction · 0.80

Calls 3

ByteSizeMethod · 0.80
valuesMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected