mirror of
https://github.com/pytorch/pytorch.git
synced 2026-11-20 09:04:25 +08:00
Revert "[JIT] Register decomp reland"
This reverts commit 81b9cb741c.
Reverted https://github.com/pytorch/pytorch/pull/76397 on behalf of https://github.com/osalpekar
This commit is contained in:
@@ -2987,9 +2987,18 @@ graph(%x.1 : Tensor):
|
||||
}
|
||||
|
||||
TEST(TestFunctionExecutor, RunDecompositionTest) {
|
||||
static auto* func = torch::jit::GetDecompositionExecutor(
|
||||
"aten::var(Tensor self, bool unbiased=True) -> Tensor");
|
||||
GraphFunction* func;
|
||||
std::once_flag flag1;
|
||||
for (bool unbiased : {true, false}) {
|
||||
std::call_once(flag1, [&]() {
|
||||
// NB: take reference to schema here, `auto schema =` will not work
|
||||
auto& schema = getOperatorForLiteral(
|
||||
"aten::var(Tensor self, bool unbiased=True) -> Tensor")
|
||||
->schema();
|
||||
auto maybe_func = GetDecompositionFunction(schema);
|
||||
TORCH_INTERNAL_ASSERT(maybe_func);
|
||||
func = *maybe_func;
|
||||
});
|
||||
auto input = at::rand({4, 4});
|
||||
Stack stack = {input, unbiased};
|
||||
func->run(stack);
|
||||
|
||||
Reference in New Issue
Block a user