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
2f071fcb
Commit
2f071fcb
authored
Sep 26, 2019
by
thomwolf
Browse files
clean up TFConv1D API
parent
57053334
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
pytorch_transformers/modeling_tf_utils.py
pytorch_transformers/modeling_tf_utils.py
+2
-2
No files found.
pytorch_transformers/modeling_tf_utils.py
View file @
2f071fcb
...
...
@@ -277,11 +277,11 @@ class TFPreTrainedModel(tf.keras.Model):
return
model
class
TFConv1D
(
tf
.
keras
.
layers
.
Layer
):
def
__init__
(
self
,
nf
,
nx
,
*
inputs
,
initializer_range
=
0.02
,
**
kwargs
):
def
__init__
(
self
,
nf
,
nx
,
initializer_range
=
0.02
,
**
kwargs
):
""" TFConv1D layer as defined by Radford et al. for OpenAI GPT (and also used in GPT-2)
Basically works like a Linear layer but the weights are transposed
"""
super
(
TFConv1D
,
self
).
__init__
(
*
inputs
,
**
kwargs
)
super
(
TFConv1D
,
self
).
__init__
(
**
kwargs
)
self
.
nf
=
nf
self
.
nx
=
nx
self
.
initializer_range
=
initializer_range
...
...
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