fix context nonetype bug

pull/8841/head
zjun 4 years ago
parent db89b1674c
commit 2172454997

@ -244,7 +244,7 @@ class Cell(Cell_):
raise AttributeError("'{}' object has no attribute '{}'.".format(type(self).__name__, name))
def __del__(self):
if context.get_context("mode") == context.PYNATIVE_MODE:
if context is not None and context.get_context("mode") == context.PYNATIVE_MODE:
_pynative_exec.clear(str(id(self)))
if hasattr(self, "_create_time"):
_executor.del_net_res(str(self._create_time))

Loading…
Cancel
Save