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
Fairseq
Commits
0a836276
Commit
0a836276
authored
Dec 06, 2017
by
Myle Ott
Browse files
Fix conv padding for even kernel widths
parent
10bf4074
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
fairseq/models/fconv.py
fairseq/models/fconv.py
+1
-1
fairseq/modules/conv_tbc.py
fairseq/modules/conv_tbc.py
+1
-1
No files found.
fairseq/models/fconv.py
View file @
0a836276
...
...
@@ -58,7 +58,7 @@ class FConvEncoder(FairseqEncoder):
self
.
projections
=
nn
.
ModuleList
()
self
.
convolutions
=
nn
.
ModuleList
()
for
(
out_channels
,
kernel_size
)
in
convolutions
:
pad
=
(
kernel_size
-
1
)
/
/
2
pad
=
(
kernel_size
-
1
)
/
2
self
.
projections
.
append
(
Linear
(
in_channels
,
out_channels
)
if
in_channels
!=
out_channels
else
None
)
self
.
convolutions
.
append
(
...
...
fairseq/modules/conv_tbc.py
View file @
0a836276
...
...
@@ -59,7 +59,7 @@ class ConvTBCFunction(Function):
kernel_size
=
weight_size
[
0
]
output
=
input
.
new
(
input_size
[
0
]
-
kernel_size
+
1
+
pad
*
2
,
input_size
[
0
]
-
kernel_size
+
1
+
int
(
pad
*
2
)
,
input_size
[
1
],
weight_size
[
2
])
...
...
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