From a949bca4e79030f0f625d5b85b0269220dc953d5 Mon Sep 17 00:00:00 2001
From: Yoann Schneider <yschneider@teklia.com>
Date: Wed, 8 Mar 2023 10:24:09 +0000
Subject: [PATCH] approved suggestion

---
 dan/predict/attention.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/dan/predict/attention.py b/dan/predict/attention.py
index a2657f5d..3d32b5c8 100644
--- a/dan/predict/attention.py
+++ b/dan/predict/attention.py
@@ -44,8 +44,7 @@ def compute_coverage(text: str, max_value: float, offset: int, attentions):
     # blank vector to accumulate weights for the current text
     coverage_vector = np.zeros((height, width))
     for i in range(len(text)):
-        local_weight = attentions[i + offset]
-        local_weight = cv2.resize(local_weight, (width, height))
+        local_weight = cv2.resize(attentions[i + offset], (width, height))
         coverage_vector = np.clip(coverage_vector + local_weight, 0, 1)
 
     # Normalize coverage vector
-- 
GitLab