#include #include #include #include #include #include // ${generated_comment} namespace at { namespace { struct OpNameEquals final { bool operator()(const std::pair& lhs, const std::pair& rhs) const { return 0 == strcmp(lhs.first, rhs.first) && 0 == strcmp(lhs.second, rhs.second); } }; struct OpNameHash final { size_t operator()(const std::pair& p) const { // use std::hash because std::hash would hash pointers and not pointed-to strings return std::hash()(p.first) ^ (~ std::hash()(p.second)); } }; } bool is_custom_op(const c10::OperatorName& opName) { static std::unordered_set, OpNameHash, OpNameEquals> ops { ${aten_ops} {"", ""} }; return ops.count(std::make_pair( opName.name.c_str(), opName.overload_name.c_str())) == 0; } }