xref: /aosp_15_r20/external/pytorch/torch/csrc/lazy/ts_backend/ts_eager_fallback.h (revision da0073e96a02ea20f0ac840b70461e3646d07c45)
1 #pragma once
2 
3 #include <ATen/core/dispatch/Dispatcher.h>
4 #include <ATen/core/ivalue.h>
5 #include <ATen/core/stack.h>
6 #include <functional>
7 
8 namespace torch {
9 namespace lazy {
10 
11 bool force_eager_fallback(c10::Symbol op);
12 void ltc_eager_fallback(
13     const c10::OperatorHandle& op,
14     torch::jit::Stack* stack);
15 
16 void ts_eager_fallback(
17     const c10::OperatorHandle& op,
18     torch::jit::Stack* stack,
19     c10::DeviceType device_type);
20 
21 // The TorchScript backend does not register itself with pytorch dispatcher
22 // until it is explicitly initialized.  This function should only be called
23 // by the main Torchscript backend init function.
24 void register_ts_ltc_eager_fallback();
25 
26 } // namespace lazy
27 } // namespace torch
28