Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
de13a951
Unverified
Commit
de13a951
authored
Jan 26, 2024
by
Sanchit Gandhi
Committed by
GitHub
Jan 26, 2024
Browse files
[Flax] Update no init test for Flax v0.7.1 (#28735)
parent
abe0289e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
tests/test_modeling_flax_common.py
tests/test_modeling_flax_common.py
+1
-1
No files found.
tests/test_modeling_flax_common.py
View file @
de13a951
...
@@ -984,7 +984,7 @@ class FlaxModelTesterMixin:
...
@@ -984,7 +984,7 @@ class FlaxModelTesterMixin:
# Check if we params can be properly initialized when calling init_weights
# Check if we params can be properly initialized when calling init_weights
params
=
model
.
init_weights
(
model
.
key
,
model
.
input_shape
)
params
=
model
.
init_weights
(
model
.
key
,
model
.
input_shape
)
self
.
assert
IsI
nstance
(
params
,
FrozenDict
)
assert
isi
nstance
(
params
,
(
dict
,
FrozenDict
)
),
f
"params are not an instance of
{
FrozenDict
}
"
# Check if all required parmas are initialized
# Check if all required parmas are initialized
keys
=
set
(
flatten_dict
(
unfreeze
(
params
)).
keys
())
keys
=
set
(
flatten_dict
(
unfreeze
(
params
)).
keys
())
self
.
assertTrue
(
all
(
k
in
keys
for
k
in
model
.
required_params
))
self
.
assertTrue
(
all
(
k
in
keys
for
k
in
model
.
required_params
))
...
...
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