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
c73e3532
Unverified
Commit
c73e3532
authored
May 17, 2021
by
Patrick von Platen
Committed by
GitHub
May 17, 2021
Browse files
push (#11750)
parent
936b5715
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/bert/modeling_flax_bert.py
src/transformers/models/bert/modeling_flax_bert.py
+1
-1
No files found.
src/transformers/models/bert/modeling_flax_bert.py
View file @
c73e3532
...
...
@@ -551,7 +551,7 @@ class FlaxBertPreTrainedModel(FlaxPreTrainedModel):
def
init_weights
(
self
,
rng
:
jax
.
random
.
PRNGKey
,
input_shape
:
Tuple
)
->
FrozenDict
:
# init input tensors
input_ids
=
jnp
.
zeros
(
input_shape
,
dtype
=
"i4"
)
token_type_ids
=
jnp
.
one
s_like
(
input_ids
)
token_type_ids
=
jnp
.
zero
s_like
(
input_ids
)
position_ids
=
jnp
.
broadcast_to
(
jnp
.
arange
(
jnp
.
atleast_2d
(
input_ids
).
shape
[
-
1
]),
input_shape
)
attention_mask
=
jnp
.
ones_like
(
input_ids
)
...
...
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