Created
March 24, 2022 04:07
-
-
Save jamesr66a/db1401015ad4d05eac17e9dd3f651288 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/transformers/utils/fx.py b/src/transformers/utils/fx.py | |
index 0270295dd..acf3deaf4 100644 | |
--- a/src/transformers/utils/fx.py | |
+++ b/src/transformers/utils/fx.py | |
@@ -485,18 +485,18 @@ class HFTracer(Tracer): | |
_reset_tensor_methods(self.original_methods) | |
- # TODO: keep this until necessary. | |
- # This is necessary because concrete args are added as input to the traced module since | |
- # https://github.com/pytorch/pytorch/pull/55888. | |
- # A PR that solves this was posted: https://github.com/pytorch/pytorch/pull/59569 but it was not merged yet. | |
- for node in self.graph.nodes: | |
- if node.op == "placeholder": | |
- # Removing default values for inputs as the forward pass will fail with them. | |
- if node.target in input_names: | |
- node.args = () | |
- # It is a concrete arg so it is not used and should be removed. | |
- else: | |
- self.graph.erase_node(node) | |
+ # # TODO: keep this until necessary. | |
+ # # This is necessary because concrete args are added as input to the traced module since | |
+ # # https://github.com/pytorch/pytorch/pull/55888. | |
+ # # A PR that solves this was posted: https://github.com/pytorch/pytorch/pull/59569 but it was not merged yet. | |
+ # for node in self.graph.nodes: | |
+ # if node.op == "placeholder": | |
+ # # Removing default values for inputs as the forward pass will fail with them. | |
+ # if node.target in input_names: | |
+ # node.args = () | |
+ # # It is a concrete arg so it is not used and should be removed. | |
+ # else: | |
+ # self.graph.erase_node(node) | |
return self.graph |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment