Function definition proto.
(self)
| 313 | |
| 314 | @property |
| 315 | def definition(self): |
| 316 | """Function definition proto.""" |
| 317 | self._create_definition_if_needed() |
| 318 | if self._c_func: |
| 319 | with c_api_util.tf_buffer() as buf: |
| 320 | c_api.TF_FunctionToFunctionDef(self._c_func.func, buf) |
| 321 | fdef = function_pb2.FunctionDef() |
| 322 | proto_data = c_api.TF_GetBuffer(buf) |
| 323 | fdef.ParseFromString(compat.as_bytes(proto_data)) |
| 324 | with ops.init_scope(): |
| 325 | if context.executing_eagerly(): |
| 326 | context.add_function(self._c_func.func) |
| 327 | self._function_deleter = _DefinedFunctionDeleter( |
| 328 | fdef.signature.name) |
| 329 | return fdef |
| 330 | return self._definition |
| 331 | |
| 332 | @property |
| 333 | def _signature(self): |
nothing calls this directly
no test coverage detected