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
OpenDAS
FastMoE
Commits
6429fa29
Commit
6429fa29
authored
Jan 03, 2021
by
Jiezhong Qiu
Browse files
2 out of 32 experts
parent
1bde1726
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
pytorch/mem_transformer.py
pytorch/mem_transformer.py
+1
-1
No files found.
pytorch/mem_transformer.py
View file @
6429fa29
...
@@ -34,7 +34,7 @@ class PositionalEmbedding(nn.Module):
...
@@ -34,7 +34,7 @@ class PositionalEmbedding(nn.Module):
return
pos_emb
[:,
None
,:]
return
pos_emb
[:,
None
,:]
class
CustomizedMoEPositionwiseFF
(
nn
.
Module
):
class
CustomizedMoEPositionwiseFF
(
nn
.
Module
):
def
__init__
(
self
,
d_model
,
d_inner
,
dropout
,
pre_lnorm
=
False
,
top_k
=
2
,
num_expert
=
4
):
def
__init__
(
self
,
d_model
,
d_inner
,
dropout
,
pre_lnorm
=
False
,
top_k
=
2
,
num_expert
=
32
):
super
(
CustomizedMoEPositionwiseFF
,
self
).
__init__
()
super
(
CustomizedMoEPositionwiseFF
,
self
).
__init__
()
print
(
"CustomizedMoEPositionwiseFF num_expert=%d top_k=%d"
%
(
num_expert
,
top_k
))
print
(
"CustomizedMoEPositionwiseFF num_expert=%d top_k=%d"
%
(
num_expert
,
top_k
))
...
...
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