17 #include "torch/csrc/jit/jit_log.h" 18 #include "torch/script.h" 26 enum Device : int8_t { GPU = 0, CPU, XPU, UNKNOW };
31 bool use_fp16 =
false;
32 bool is_dynamic =
false;
33 bool long_to_int =
true;
34 uint64_t max_workspace_size = 1ULL << 30;
35 int32_t device_id = -1;
36 int32_t unconst_ops_thres = -1;
37 bool use_nvidia_tf32 =
false;
41 class PorosModule :
public torch::jit::Module {
43 PorosModule(torch::jit::Module module) : torch::jit::Module(module) {}
44 ~PorosModule() =
default;
46 void to_device(Device device) { _options.device = device; }
51 PorosOptions _options;
55 std::unique_ptr<PorosModule> Load(
const std::string& filename,
56 const PorosOptions& options);