1 | #pragma once |
---|---|
2 | |
3 | #include <c10/macros/Export.h> |
4 | #include <c10/util/Optional.h> |
5 | |
6 | #include <memory> |
7 | #include <unordered_map> |
8 | #include <unordered_set> |
9 | |
10 | namespace torch { |
11 | namespace jit { |
12 | |
13 | // Struct storing metadata of an operator that can be useful for versioning |
14 | struct OperatorInfo { |
15 | // The number of arguments within the schema of the op |
16 | c10::optional<int> num_schema_args; |
17 | }; |
18 | |
19 | struct RuntimeCompatibilityInfo { |
20 | std::pair<uint64_t, uint64_t> min_max_supported_bytecode_version; |
21 | std::unordered_map<std::string, OperatorInfo> operator_info; |
22 | std::unordered_set<std::string> supported_types; |
23 | std::pair<uint64_t, uint64_t> min_max_supported_opperator_versions; |
24 | |
25 | // Factory Method |
26 | static TORCH_API RuntimeCompatibilityInfo get(); |
27 | }; |
28 | |
29 | TORCH_API uint64_t _get_runtime_bytecode_version(); |
30 | |
31 | TORCH_API std::pair<uint64_t, uint64_t> _get_runtime_bytecode_min_max_versions(); |
32 | |
33 | TORCH_API std::pair<uint64_t, uint64_t> |
34 | _get_runtime_operators_min_max_versions(); |
35 | |
36 | TORCH_API std::unordered_map<std::string, OperatorInfo> |
37 | _get_runtime_ops_and_info(); |
38 | |
39 | TORCH_API std::unordered_set<std::string> _get_mobile_supported_types(); |
40 | |
41 | TORCH_API std::unordered_set<std::string> _get_loaded_custom_classes(); |
42 | |
43 | } // namespace jit |
44 | } // namespace torch |
45 |