From 0c97b2a3ec4e5dd4aa6781d4058eb13d3bab0214 Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Thu, 8 Jul 2021 19:56:38 +0800 Subject: [PATCH] fix(module): remove assert during forward GitOrigin-RevId: bb04d861a3a2b5228de8f29bad9e1a87c5fbd8e2 --- imperative/python/megengine/module/normalization.py | 1 - 1 file changed, 1 deletion(-) diff --git a/imperative/python/megengine/module/normalization.py b/imperative/python/megengine/module/normalization.py index f524d03e..317fa17d 100644 --- a/imperative/python/megengine/module/normalization.py +++ b/imperative/python/megengine/module/normalization.py @@ -136,7 +136,6 @@ class LayerNorm(Module): def forward(self, x): x_shape = x.shape - assert x_shape[-len(self.normalized_shape) :] == self.normalized_shape dim_delta = len(x_shape) - len(self.normalized_shape) non_flatten_shape = x_shape[:dim_delta] x = x.reshape(*non_flatten_shape, -1)