mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
improve error message on inferred type (#21058)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/21058 ghimport-source-id: e7d6e082b0faf4f3d3e683f2c98863ee269439f0 Differential Revision: D15534670 Pulled By: suo fbshipit-source-id: 8bbfd6e9c1afbc3006d7d55ed633e18618e05021
This commit is contained in:
committed by
Facebook Github Bot
parent
6ea9044d3c
commit
5dacf6b048
@@ -62,9 +62,9 @@ TEST(TorchScriptTest, TestNestedIValueModuleArgMatching) {
|
||||
} catch (const c10::Error& error) {
|
||||
AT_ASSERT(
|
||||
std::string(error.what_without_backtrace())
|
||||
.find("Expected value of type Tensor[][] for argument 'a' in "
|
||||
"position 0, but instead got value of type t[][][]") == 0);
|
||||
|
||||
.find("nested_loop() expected a value of type 'List[List[Tensor]]'"
|
||||
" for argument 'a' but instead found type "
|
||||
"'List[List[List[t]]]'") == 0);
|
||||
};
|
||||
|
||||
std::vector<torch::jit::IValue> gen_list;
|
||||
@@ -81,9 +81,9 @@ TEST(TorchScriptTest, TestNestedIValueModuleArgMatching) {
|
||||
//so the error message is not helpful here.
|
||||
AT_ASSERT(
|
||||
std::string(error.what_without_backtrace())
|
||||
.find("Expected value of type Tensor[][] for argument 'a' in "
|
||||
"position 0, but instead got value of type Tensor[][]") == 0);
|
||||
|
||||
.find("nested_loop() expected a value of type "
|
||||
"'List[List[Tensor]]' for argument 'a' but "
|
||||
"instead found type 'List[List[Tensor]]'") == 0);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user