[static runtime] Fix linalg_solve test case (#79971)

Summary: Added the third bool argument in inalg_solve test case to remove the runtime error.

Test Plan: buck run mode/opt caffe2/benchmarks/static_runtime:static_runtime_cpptest

Reviewed By: mikeiovine

Differential Revision: D37324419

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79971
Approved by: https://github.com/tenpercent
This commit is contained in:
Hui Guo
2022-06-22 16:31:25 +00:00
committed by PyTorch MergeBot
parent 184443f1b4
commit a622e3e14d

View File

@ -7770,16 +7770,17 @@ TEST(StaticRuntime, autogen_linalg_cond) {
TEST(StaticRuntime, autogen_linalg_solve) {
const std::string script = R"IR(
graph(%input: Tensor, %other: Tensor):
graph(%A: Tensor, %B: Tensor, %left: bool):
%bias: None = prim::Constant()
%ret = aten::linalg_solve(%input, %other)
%ret = aten::linalg_solve(%A, %B, %left)
%cloned = aten::clone(%ret, %bias)
return (%cloned)
)IR";
auto input0 = at::rand({6, 6, 6});
auto other0 = at::rand({6, 6, 6});
std::vector<IValue> args{input0, other0};
auto A0 = at::rand({6, 6, 6});
auto B0 = at::rand({6, 6, 6});
auto left0 = false;
std::vector<IValue> args{A0, B0, left0};
testStaticRuntime(
script,
args,
@ -7788,9 +7789,10 @@ TEST(StaticRuntime, autogen_linalg_solve) {
/*use_equalnan=*/false,
/*check_resize=*/true);
auto input1 = at::rand({22, 22, 22});
auto other1 = at::rand({22, 22, 22});
std::vector<IValue> args2{input1, other1};
auto A1 = at::rand({22, 22, 22});
auto B1 = at::rand({22, 22, 22});
auto left1 = false;
std::vector<IValue> args2{A1, B1, left1};
testStaticRuntime(
script,
args,