Skip to content

Commit 4e7655b

Browse files
authored
Update conv.py
1 parent 8e615dd commit 4e7655b

File tree

1 file changed

+3
-3
lines changed
  • neural_sp/models/seq2seq/encoders

1 file changed

+3
-3
lines changed

neural_sp/models/seq2seq/encoders/conv.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ def __init__(self, in_channel, out_channel,
218218
kernel_size=kernel_size,
219219
stride=stride,
220220
padding=1)
221-
self._odim = update_lens_1d(torch.IntTensor([in_channel]), self.conv1)[0].item()
221+
self._odim = out_channel
222222
self.batch_norm1 = nn.BatchNorm1d(out_channel) if batch_norm else lambda x: x
223223
self.layer_norm1 = nn.LayerNorm(out_channel,
224224
eps=layer_norm_eps) if layer_norm else lambda x: x
@@ -229,7 +229,7 @@ def __init__(self, in_channel, out_channel,
229229
kernel_size=kernel_size,
230230
stride=stride,
231231
padding=1)
232-
self._odim = update_lens_1d(torch.IntTensor([self._odim]), self.conv2)[0].item()
232+
self._odim = out_channel
233233
self.batch_norm2 = nn.BatchNorm1d(out_channel) if batch_norm else lambda x: x
234234
self.layer_norm2 = nn.LayerNorm(out_channel,
235235
eps=layer_norm_eps) if layer_norm else lambda x: x
@@ -242,7 +242,7 @@ def __init__(self, in_channel, out_channel,
242242
padding=0,
243243
ceil_mode=True)
244244
# NOTE: If ceil_mode is False, remove last feature when the dimension of features are odd.
245-
self._odim = update_lens_1d(torch.IntTensor([self._odim]), self.pool)[0].item()
245+
self._odim = self._odim
246246
if self._odim % 2 != 0:
247247
self._odim = (self._odim // 2) * 2
248248
# TODO(hirofumi0810): more efficient way?

0 commit comments

Comments
 (0)