This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
from torch import tensor, device | |
import torch.fx as fx | |
from torch._dynamo.testing import rand_strided | |
from math import inf | |
import torch._inductor.inductor_prims | |
import torch._dynamo.config | |
import torch._inductor.config | |
import torch._functorch.config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In my_cpp_file_that_registers_ops_to_the_dispatcher.cpp | |
#include <ATen/FunctionalTensorWrapper.h> | |
#include <torch/library.h> | |
// The implementation of my out-of-place op, "foo" | |
at::Tensor foo_impl(const at::Tensor& x) { | |
return x.mul(2); | |
} |