Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/63005
Realized I forgot to move the Runtime half of these functions be within the struct.
Test Plan: ci
Reviewed By: pavithranrao
Differential Revision:
D30205521
fbshipit-source-id:
ccd87d7d78450dd0dd23ba493bbb9d87be4640a5
TEST(LiteInterpreterTest, isCompatibleSuccess) {
// test trivial success case
- auto runtime_info = get_runtime_compatibility_info();
+ auto runtime_info = RuntimeCompatibilityInfo::get();
std::unordered_map<std::string, OperatorInfo> model_ops;
model_ops["aten::add.Scalar"] = OperatorInfo{2};
return result;
}
-RuntimeCompatibilityInfo get_runtime_compatibility_info() {
+RuntimeCompatibilityInfo RuntimeCompatibilityInfo::get() {
return RuntimeCompatibilityInfo{
_get_runtime_bytecode_version(), _get_runtime_ops_and_info()};
}
struct RuntimeCompatibilityInfo {
uint64_t bytecode_version;
std::unordered_map<std::string, OperatorInfo> operator_info;
+
+ // Factory Method
+ static TORCH_API RuntimeCompatibilityInfo get();
};
TORCH_API uint64_t _get_runtime_bytecode_version();
TORCH_API std::unordered_map<std::string, OperatorInfo>
_get_runtime_ops_and_info();
-TORCH_API RuntimeCompatibilityInfo get_runtime_compatibility_info();
-
} // namespace jit
} // namespace torch