Skip to content

Commit 1dba4ad

Browse files
upgrade unevaluated array as argument warning
logger.warning does not deduplicate, in contrast to warnings.warn
1 parent 029026c commit 1dba4ad

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arraycontext/impl/pytato/compile.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -550,13 +550,11 @@ def _args_to_device_buffers(actx, input_id_to_name_in_program, arg_id_to_arg):
550550
pass
551551
elif isinstance(arg, pt.Array):
552552
# got an array expression => evaluate it
553-
from warnings import warn
554-
warn(f"Argument array '{arg_id}' to a compiled function is "
553+
logger.warning("Argument array '%s' to a compiled function is "
555554
"unevaluated. Evaluating just-in-time, at "
556555
"considerable expense. This is deprecated and will stop "
557556
"working in 2023. To avoid this warning, force evaluation "
558-
"of all arguments via freeze/thaw.",
559-
DeprecationWarning, stacklevel=4)
557+
"of all arguments via freeze/thaw.", arg_id)
560558

561559
arg = actx.freeze(arg)
562560
else:

0 commit comments

Comments
 (0)