Skip to content

Commit

Permalink
xxxxx
Browse files Browse the repository at this point in the history
Signed-off-by: Jinzhe Zeng <[email protected]>
  • Loading branch information
njzjz committed Oct 8, 2024
1 parent 013883c commit bf6db03
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion source/tests/universal/dpmodel/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def _get_deserialized_module(cls):

@property
def deserialized_module(self):
return self._get_deserialized_module()
if hasattr(self.__class__, "module"):
return self._get_deserialized_module()
return self.module.deserialize(self.module.serialize())

@property
def modules_to_test(self):
Expand Down
9 changes: 7 additions & 2 deletions source/tests/universal/pt/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ def _get_script_module(cls):

@property
def script_module(self):
return self._get_script_module()
if hasattr(self.__class__, "module"):
return self._get_script_module()
with torch.jit.optimized_execution(False):
return torch.jit.script(self.module)

@classmethod
@cache
Expand All @@ -39,7 +42,9 @@ def _get_deserialized_module(cls):

@property
def deserialized_module(self):
return self._get_deserialized_module()
if hasattr(self.__class__, "module"):
return self._get_deserialized_module()
return self.module.deserialize(self.module.serialize())

@property
def modules_to_test(self):
Expand Down

0 comments on commit bf6db03

Please sign in to comment.