From 7ef710285d815d6d17d72a64dfb20c1a76d90310 Mon Sep 17 00:00:00 2001 From: wrongtest Date: Wed, 23 Feb 2022 00:07:55 +0800 Subject: [PATCH] check to avoid crash in opt_level=0 vm build --- src/relay/transforms/memory_alloc.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/relay/transforms/memory_alloc.cc b/src/relay/transforms/memory_alloc.cc index 900442e9b9a8..5b584e199dc7 100644 --- a/src/relay/transforms/memory_alloc.cc +++ b/src/relay/transforms/memory_alloc.cc @@ -140,6 +140,9 @@ class DialectRewriter : public transform::DeviceAwareExprMutator { VirtualDevice virtual_device = GetVirtualDevice(call); ICHECK(!virtual_device->IsFullyUnconstrained()); + ICHECK(!scopes_.empty()) + << "Calls out of a let block are not supported, do you forget to transform " + << "with ToANormalForm or set opt_level >= 1 in the pass context?"; LetList& scope = scopes_.back(); std::vector new_args;