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