From 05a188792a2a3eee0a4ea9a0b69d5dc82b4119fc Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Thu, 6 Jun 2024 00:14:13 +0200 Subject: Fix bug in from_name --- polymatrix/expression/from_.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/polymatrix/expression/from_.py b/polymatrix/expression/from_.py index ce35a83..03091c7 100644 --- a/polymatrix/expression/from_.py +++ b/polymatrix/expression/from_.py @@ -117,6 +117,16 @@ def from_name( if isinstance(shape, Expression): shape = shape.underlying + elif isinstance(shape, tuple): + nrows, ncols = shape + if isinstance(nrows, Expression): + nrows = nrows.underlying + + if isinstance(ncols, Expression): + ncols = ncols.underlying + + shape = (nrows, ncols) + return init_variable_expression(init.init_variable_expr(Symbol(name), shape)) -- cgit v1.2.1