Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
fde4867f
"git@developer.sourcefind.cn:chenpangpang/transformers.git" did not exist on "e9c23fa056f401a586a1691edf773d1b9b60f96d"
Unverified
Commit
fde4867f
authored
Oct 19, 2021
by
Thomas Wang
Committed by
GitHub
Oct 19, 2021
Browse files
Fix passing None as concrete args (#14022)
parent
9eda0d15
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
0 deletions
+3
-0
src/transformers/utils/fx.py
src/transformers/utils/fx.py
+3
-0
No files found.
src/transformers/utils/fx.py
View file @
fde4867f
...
@@ -358,6 +358,9 @@ class HFTracer(Tracer):
...
@@ -358,6 +358,9 @@ class HFTracer(Tracer):
return
attr_val
return
attr_val
def
trace
(
self
,
root
:
PreTrainedModel
,
concrete_args
:
Optional
[
Dict
[
str
,
Any
]]
=
None
,
method_names
=
None
)
->
Graph
:
def
trace
(
self
,
root
:
PreTrainedModel
,
concrete_args
:
Optional
[
Dict
[
str
,
Any
]]
=
None
,
method_names
=
None
)
->
Graph
:
if
concrete_args
is
None
:
concrete_args
=
{}
sig
=
inspect
.
signature
(
root
.
forward
)
sig
=
inspect
.
signature
(
root
.
forward
)
input_names
=
sig
.
parameters
.
keys
()
-
concrete_args
.
keys
()
input_names
=
sig
.
parameters
.
keys
()
-
concrete_args
.
keys
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment