From b89970583109b64d2de4429bd67c4bd9596d53e0 Mon Sep 17 00:00:00 2001 From: Hui Zhang Date: Wed, 7 Jul 2021 09:48:39 +0000 Subject: [PATCH] size to shape --- deepspeech/modules/subsampling.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/deepspeech/modules/subsampling.py b/deepspeech/modules/subsampling.py index 5aa2fd8e..0edc6ee5 100644 --- a/deepspeech/modules/subsampling.py +++ b/deepspeech/modules/subsampling.py @@ -128,7 +128,7 @@ class Conv2dSubsampling4(BaseSubsampling): """ x = x.unsqueeze(1) # (b, c=1, t, f) x = self.conv(x) - b, c, t, f = paddle.shape(x) + b, c, t, f = x.shape x = self.out(x.transpose([0, 2, 1, 3]).reshape([b, t, c * f])) x, pos_emb = self.pos_enc(x, offset) return x, pos_emb, x_mask[:, :, :-2:2][:, :, :-2:2] @@ -181,7 +181,7 @@ class Conv2dSubsampling6(BaseSubsampling): """ x = x.unsqueeze(1) # (b, c, t, f) x = self.conv(x) - b, c, t, f = paddle.shape(x) + b, c, t, f = x.shape x = self.linear(x.transpose([0, 2, 1, 3]).reshape([b, t, c * f])) x, pos_emb = self.pos_enc(x, offset) return x, pos_emb, x_mask[:, :, :-2:2][:, :, :-4:3] -- GitLab