MCPcopy Create free account
hub / github.com/apple/coremltools / anyFeatureDescriptionOfDescription

Function anyFeatureDescriptionOfDescription

mlmodel/src/Utils.cpp:107–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105/// the specified criteria predicate function.
106template <typename Description>
107static bool anyFeatureDescriptionOfDescription(const Description &description,
108 std::function<bool(const Specification::FeatureDescription& fd)> criteria) {
109 for (const auto& fd: description.input()) {
110 if (criteria(fd)) {
111 return true;
112 }
113 }
114
115 for (const auto& fd: description.output()) {
116 if (criteria(fd)) {
117 return true;
118 }
119 }
120
121 for (const auto& fd: description.state()) {
122 if (criteria(fd)) {
123 return true;
124 }
125 }
126 return false;
127}
128
129/// A utility function to invoke a handler with input, output, and
130/// state feature description of the model.

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected