mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-04 04:07:22 +00:00
Add alternate IsSupportedOptypeVersionAndString signature (#5529)
Add a variant of graph_utils::IsSupportedOptypeVersionAndDomain that takes const char* instead of std::string.
This commit is contained in:
parent
e1a54c4090
commit
a355281b99
2 changed files with 11 additions and 0 deletions
|
|
@ -293,6 +293,13 @@ bool IsSupportedOptypeVersionAndDomain(const Node& node,
|
|||
MatchesOpSinceVersion(node, versions) && MatchesOpSetDomain(node, domain));
|
||||
}
|
||||
|
||||
bool IsSupportedOptypeVersionAndDomain(const Node& node,
|
||||
const char* op_type,
|
||||
const std::initializer_list<ONNX_NAMESPACE::OperatorSetVersion>& versions,
|
||||
const char* domain) {
|
||||
return IsSupportedOptypeVersionAndDomain(node, std::string(op_type), versions, std::string(domain));
|
||||
}
|
||||
|
||||
bool MatchesOpSinceVersion(const Node& node, const std::initializer_list<ONNX_NAMESPACE::OperatorSetVersion>& versions) {
|
||||
return std::find(versions.begin(), versions.end(), node.SinceVersion()) != versions.end();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ bool IsSupportedOptypeVersionAndDomain(const Node& node,
|
|||
const std::string& op_type,
|
||||
const std::initializer_list<ONNX_NAMESPACE::OperatorSetVersion>& versions,
|
||||
const std::string& domain = kOnnxDomainAlias);
|
||||
bool IsSupportedOptypeVersionAndDomain(const Node& node,
|
||||
const char* op_type,
|
||||
const std::initializer_list<ONNX_NAMESPACE::OperatorSetVersion>& versions,
|
||||
const char* domain = kOnnxDomainAlias);
|
||||
|
||||
/** Checks if the node has the same operator since version as the given one. */
|
||||
bool MatchesOpSinceVersion(const Node& node, const std::initializer_list<ONNX_NAMESPACE::OperatorSetVersion>& versions);
|
||||
|
|
|
|||
Loading…
Reference in a new issue