From fa0bf268ffd66cdda8db80eb3d82889df05199a3 Mon Sep 17 00:00:00 2001 From: "Wu, Zhenyu" Date: Sun, 9 Aug 2026 20:42:09 +0800 Subject: [PATCH] Replace y_q + means_hat by dequantize() dequantize() contains type_as() to ensure the output has the same type as means_hat --- compressai/models/google.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compressai/models/google.py b/compressai/models/google.py index 712ce031..f4b60b83 100644 --- a/compressai/models/google.py +++ b/compressai/models/google.py @@ -633,7 +633,7 @@ def _compress_ar(self, y_hat, params, height, width, kernel_size, padding): y_crop = y_crop[:, :, padding, padding] y_q = self.gaussian_conditional.quantize(y_crop, "symbols", means_hat) - y_hat[:, :, h + padding, w + padding] = y_q + means_hat + y_hat[:, :, h + padding, w + padding] = self.gaussian_conditional.dequantize(y_q, means_hat) symbols_list.extend(y_q.squeeze().tolist()) indexes_list.extend(indexes.squeeze().tolist())