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
31adbb24
Commit
31adbb24
authored
Oct 07, 2019
by
Rémi Louf
Browse files
add class wireframes for Bert decoder
parent
dda1adad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
transformers/modeling_bert.py
transformers/modeling_bert.py
+16
-0
No files found.
transformers/modeling_bert.py
View file @
31adbb24
...
...
@@ -331,6 +331,14 @@ class BertEncoderLayer(nn.Module):
return
outputs
class
BertDecoderLayer
(
nn
.
Module
):
def
__init__
(
self
,
config
):
raise
NotImplementedError
def
forward
(
self
,
hidden_state
,
encoder_output
):
raise
NotImplementedError
class
BertEncoder
(
nn
.
Module
):
def
__init__
(
self
,
config
):
super
(
BertEncoder
,
self
).
__init__
()
...
...
@@ -363,6 +371,14 @@ class BertEncoder(nn.Module):
return
outputs
# last-layer hidden state, (all hidden states), (all attentions)
class
BertDecoder
(
nn
.
Module
):
def
__init__
(
self
,
config
):
raise
NotImplementedError
def
forward
(
self
,
encoder_output
):
raise
NotImplementedError
class
BertPooler
(
nn
.
Module
):
def
__init__
(
self
,
config
):
super
(
BertPooler
,
self
).
__init__
()
...
...
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