mirror of
https://github.com/ml-explore/mlx.git
synced 2025-06-25 01:41:17 +08:00
improve error messaging in eval (#1101)
This commit is contained in:
parent
2e158cf6d0
commit
a9f80d60f6
@ -82,8 +82,15 @@ array eval_impl(std::vector<array> outputs, bool async) {
|
||||
"[async_eval] Not allowed inside a graph transformation.");
|
||||
}
|
||||
if (!in.has_primitive()) {
|
||||
if (in.is_tracer()) {
|
||||
throw std::invalid_argument(
|
||||
"[eval] Attempting to eval an array without a primitive.");
|
||||
"[eval] Attempting to eval an array during function"
|
||||
" transformations like compile or vmap is not allowed.");
|
||||
}
|
||||
throw std::runtime_error(
|
||||
"[eval] Attempting to eval an array without a primitive. "
|
||||
"This may be a bug, please file an issue here: "
|
||||
" https://github.com/ml-explore/mlx/issues.");
|
||||
}
|
||||
if (a.primitive().stream() != in.primitive().stream()) {
|
||||
needs_signal.insert(in.id());
|
||||
|
Loading…
Reference in New Issue
Block a user