"The size of tensor a (2) must match the size of tensor b (3) at non-singleton dimension 1");
}
EXPECT_TRUE(exception_handled);
+
+ FLAGS_torch_jit_enable_rethrow_caught_exception = true;
+ c10::intrusive_ptr<Future> future = interp.runAsync(stack);
+ future->wait();
+ ASSERT_TRUE(future->completed());
+ ASSERT_TRUE(future->hasError());
+ try {
+ std::rethrow_exception(future->exception_ptr());
+ } catch (c10::Error& e) {
+ std::string exception_msg = e.what_without_backtrace();
+ EXPECT_STREQ(
+ exception_msg.c_str(),
+ "The size of tensor a (2) must match the size of tensor b (3) at non-singleton dimension 1");
+ }
+
FLAGS_torch_jit_enable_rethrow_caught_exception = original_flag_value;
}