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

Class _DefinedFunctionDeleter

tensorflow/python/framework/function.py:195–214  ·  view source on GitHub ↗

Unregister function from eager context.

Source from the content-addressed store, hash-verified

193
194
195class _DefinedFunctionDeleter(object):
196 """Unregister function from eager context."""
197
198 def __init__(self, name):
199 self.name = name
200
201 def __del__(self):
202 try:
203 context.remove_function(self.name)
204 except TypeError:
205 # Suppress some exceptions, mainly for the case when we're running on
206 # module deletion. Things that can go wrong include the context module
207 # already being unloaded, self._handle._handle_data no longer being
208 # valid, and so on. Printing warnings in these cases is silly
209 # (exceptions raised from __del__ are printed as warnings to stderr).
210 pass # 'NoneType' object is not callable when the handle has been
211 # partially unloaded.
212 except AttributeError:
213 pass # 'NoneType' object has no attribute 'eager_mode' when context has
214 # been unloaded. Will catch other module unloads as well.
215
216
217class _DefinedFunction(object):

Callers 1

definitionMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected