Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc committed Jul 21, 2023
1 parent 9b28982 commit be3c270
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
10 changes: 5 additions & 5 deletions paconvert/api_mapping.json
Original file line number Diff line number Diff line change
Expand Up @@ -6674,7 +6674,7 @@
"Matcher": "TensorUnchangeMatcher"
},
"torch.nn.Module.bfloat16": {
"Matcher": "NnModuleTypeMatcher",
"Matcher": "GenericMatcher",
"paddle_api": "paddle.nn.Layer.to"
},
"torch.nn.Module.buffers": {
Expand All @@ -6694,22 +6694,22 @@
"torch.nn.Module.cpu": {},
"torch.nn.Module.cuda": {},
"torch.nn.Module.double": {
"Matcher": "NnModuleTypeMatcher",
"Matcher": "GenericMatcher",
"paddle_api": "paddle.nn.Layer.to"
},
"torch.nn.Module.eval": {
"Matcher": "TensorUnchangeMatcher"
},
"torch.nn.Module.float": {
"Matcher": "NnModuleTypeMatcher",
"Matcher": "GenericMatcher",
"paddle_api": "paddle.nn.Layer.to"
},
"torch.nn.Module.get_buffer": {},
"torch.nn.Module.get_extra_state": {},
"torch.nn.Module.get_parameter": {},
"torch.nn.Module.get_submodule": {},
"torch.nn.Module.half": {
"Matcher": "NnModuleTypeMatcher",
"Matcher": "GenericMatcher",
"paddle_api": "paddle.nn.Layer.to"
},
"torch.nn.Module.ipu": {},
Expand Down Expand Up @@ -6867,7 +6867,7 @@
"paddle_api": "paddle.nn.Layer.train"
},
"torch.nn.Module.type": {
"Matcher": "NnModuleTypeMatcher",
"Matcher": "GenericMatcher",
"paddle_api": "paddle.nn.Layer.to"
},
"torch.nn.Module.xpu": {},
Expand Down
9 changes: 0 additions & 9 deletions paconvert/api_matcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -3651,15 +3651,6 @@ def get_paddle_nodes(self, args, kwargs):
return node


class NnModuleToMatcher(BaseMatcher):
def generate_code(self, kwargs):
kwargs = self.parse_kwargs(kwargs)
if "non_blocking" in kwargs:
kwargs["blocking"] = not kwargs["non_blocking"]
del kwargs["non_blocking"]
return GenericMatcher.generate_code(self, kwargs)


class SizeAverageMatcher(BaseMatcher):
def generate_code(self, kwargs):
process_reduce_and_size_average(kwargs)
Expand Down

0 comments on commit be3c270

Please sign in to comment.