From 5dabd12c9ac373c681448cf7cbab1ec017f77eb2 Mon Sep 17 00:00:00 2001 From: mcDandy Date: Sat, 14 Feb 2026 11:42:26 +0100 Subject: [PATCH] S{N} can be a number. --- more_math/helper_functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/more_math/helper_functions.py b/more_math/helper_functions.py index 6bdd1be..b60e23c 100644 --- a/more_math/helper_functions.py +++ b/more_math/helper_functions.py @@ -65,7 +65,7 @@ def generate_dim_variables(tensor: torch.Tensor): variables = {} for dim, size in enumerate(tensor.shape): variables[f"D{dim}"] = getIndexTensorAlongDim(tensor, dim) - variables[f"S{dim}"] = torch.full(tensor.shape, fill_value=size, dtype=torch.float32, device=tensor.device) + variables[f"S{dim}"] = float(size) # Scalar size, not tensor return variables