Skip to content

Commit

Permalink
Fix misleading error message
Browse files Browse the repository at this point in the history
  • Loading branch information
padix-key authored and patrick-kidger committed Jul 24, 2024
1 parent c2f19db commit b877cf8
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions jaxtyping/_array_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,11 @@ def _check_dims(
except NameError as e:
raise AnnotationError(
f"Cannot process symbolic axis '{cls_dim.elem}' as "
"some axis names have not been processed. In practice you "
"should usually only use symbolic axes in annotations "
"for return types, referring only to axes annotated for "
"arguments."
"some axis names have not been processed. "
"Have you applied the `jaxtyped` decorator? "
"In practice you should usually only use symbolic axes in "
"annotations for return types, referring only to axes "
"annotated for arguments."
) from e
if eval_size != obj_size:
return f"the dimension size {obj_size} does not equal the existing value of {cls_dim.elem}={eval_size}" # noqa: E501
Expand Down

0 comments on commit b877cf8

Please sign in to comment.