E-TE0004 — Type mismatch
Error Type |
|
|---|---|
Phase |
type checking the model |
Python exception |
|
Message
Could not match actual type `{actual}` with expected `{expected}`
Cause
An expression has a different type than the context requires. Typical examples are passing a continuous (float) expression where a natural number is required (such as a shape or an index bound), or supplying an element of the wrong type to a typed container. The expected part may be a concrete type or a description of the requirement (for example, indexable type or literal natural number < 3).
Fix
Compare the expected and actual types in the message and adjust the expression, e.g. declare the placeholder with the required data type (dtype=jm.DataType.INTEGER instead of FLOAT) or convert the expression so it produces the expected type.