E-TE0016 — Invalid dimension expression
Error Type |
|
|---|---|
Phase |
type checking the model |
Python exception |
|
Message
Invalid dimension: expected {expected} not involving decision variables, but got `{dim}`
Cause
A dimension in the subscripted array’s shape does not have a plain natural-number type free of decision variables. The message reports the type of the offending dimension, not of the subscript — an invalid subscript such as a float or decision-variable index is reported as E-TE0004 instead. Shapes passed directly to Placeholder are already validated at declaration time (also as E-TE0004), so this error normally points at an array type whose dimension was derived internally rather than declared.
Fix
Make sure every expression used as an array dimension is integer-valued and contains no decision variables. If a shape comes from data, declare that placeholder with an integer data type (e.g. dtype=jm.DataType.NATURAL).