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:
PyTorch MergeBot
2022-04-28 03:33:29 +00:00
parent 2af0c42ac0
commit a5bc02aeb2
8 changed files with 16 additions and 81 deletions
+11 -2
View File
@@ -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);