From e4d384f7663ef7636397aa345744b71642681ea1 Mon Sep 17 00:00:00 2001 From: andy0001 Date: Thu, 19 May 2022 19:04:43 +0800 Subject: [PATCH] =?UTF-8?q?Muls=E7=AE=97=E5=AD=90=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=BAMul?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dev/cv/image_classification/DIN_ID2837_for_PyTorch/layer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PyTorch/dev/cv/image_classification/DIN_ID2837_for_PyTorch/layer.py b/PyTorch/dev/cv/image_classification/DIN_ID2837_for_PyTorch/layer.py index ca24a1b63b..1ef0515463 100644 --- a/PyTorch/dev/cv/image_classification/DIN_ID2837_for_PyTorch/layer.py +++ b/PyTorch/dev/cv/image_classification/DIN_ID2837_for_PyTorch/layer.py @@ -122,7 +122,7 @@ class AttentionLayer( nn.Module): combination = torch.cat( [ fact, query, fact * query, query - fact ], dim = 2) scores = self.model( combination).squeeze() - scores = torch.where( mask == 1, scores, torch.ones_like( scores) * ( -2 ** 31 ) ) + scores = torch.where( mask == 1, scores, torch.ones_like( scores) * ( -65504 ) ) scores = ( scores.softmax( dim = -1) * mask ).view( (B , 1, T)) -- Gitee