2 #include <c10/util/Optional.h> 6 #include <torch/csrc/WindowsTorchApiMacro.h> 7 #include <ATen/core/ivalue.h> 25 struct InterpreterStateImpl;
28 using Stack = std::vector<c10::IValue>;
29 using c10::ivalue::Future;
33 Code() : pImpl(
nullptr) {}
34 explicit Code(
const std::shared_ptr<Graph>& graph);
37 const std::vector<GraphExecutor*>& grad_executors();
39 explicit operator bool()
const {
40 return pImpl !=
nullptr;
44 std::shared_ptr<CodeImpl> pImpl;
46 friend std::ostream& operator<<(std::ostream& out,
const Code& code);
51 void run(Stack& stack);
67 const char* what()
const noexcept
override {
72 : future(std::move(future_)) {}
79 : state(state_), stack(std::move(stack_)), grad_mode_enabled(grad_mode_enabled_) {}
86 bool grad_mode_enabled;
To register your own kernel for an operator, do in one (!) cpp file: C10_REGISTER_KERNEL(OperatorHand...
Flush-To-Zero and Denormals-Are-Zero mode.