Example #1
0
 def context(self) -> contextlib.AbstractContextManager:
     """Returns a contextmanager for the current TF graph."""
     if self.graph:
         return self.graph.as_default()
     else:
         return ModelV2.context(self)
Example #2
0
 def context(self):
     """Returns a contextmanager for the current TF graph."""
     if self.graph:
         return self.graph.as_default()
     else:
         return ModelV2.context(self)