From 63a0c22da3a6c9489091eb3ef0e3f3d5ea697eb9 Mon Sep 17 00:00:00 2001 From: mcDandy Date: Thu, 22 Jan 2026 13:40:01 +0100 Subject: [PATCH] It padded even thought mode was error --- more_math/helper_functions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/more_math/helper_functions.py b/more_math/helper_functions.py index 217dbe9..73a8953 100644 --- a/more_math/helper_functions.py +++ b/more_math/helper_functions.py @@ -132,6 +132,8 @@ def normalize_to_common_shape(*tensors, mode="pad"): - mode="pad": Pad with zeros to the max shape. - mode="tile": Tile to match (or exceed) dimensions, then truncate excess. """ + if mode not in ("pad", "tile"): + return tensors valid_tensors = [t for t in tensors if torch.is_tensor(t)] if len(valid_tensors) <= 1: return tensors