From b877cf83585fc059ac2ead04427b2a3e48e6a599 Mon Sep 17 00:00:00 2001 From: Patrick Kunzmann Date: Mon, 22 Jul 2024 15:26:35 +0200 Subject: [PATCH] Fix misleading error message --- jaxtyping/_array_types.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/jaxtyping/_array_types.py b/jaxtyping/_array_types.py index 8cb3dc0..6622fcb 100644 --- a/jaxtyping/_array_types.py +++ b/jaxtyping/_array_types.py @@ -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