def add_function_def(self, fdef): """Add a function definition to the context. Once added, the function (identified by its name) can be executed like any other operation. Args: fdef: A FunctionDef protocol buffer message. """ fdef_string = fdef.SerializeToString() pywrap_tensorflow.TFE_ContextAddFunctionDef(self._handle, fdef_string, len(fdef_string))
def add_function_def(self, fdef): """Add a function definition to the context. Once added, the function (identified by its name) can be executed like any other operation. Args: fdef: A FunctionDef protocol buffer message. """ fdef_string = fdef.SerializeToString() with errors.raise_exception_on_not_ok_status() as status: pywrap_tensorflow.TFE_ContextAddFunctionDef( self._handle, # pylint: disable=protected-access fdef_string, len(fdef_string), status)