MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / EnforceFlagRequirement

Function EnforceFlagRequirement

tensorflow/lite/toco/toco_cmdline_flags.cc:211–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

209// Enforces the FlagRequirements are met for a given flag.
210template <typename T>
211void EnforceFlagRequirement(const T& flag, const string& flag_name,
212 FlagRequirement requirement) {
213 if (requirement == FlagRequirement::kMustBeSpecified) {
214 QCHECK(flag.specified()) << "Missing required flag " << flag_name;
215 }
216 if (requirement == FlagRequirement::kMustNotBeSpecified) {
217 QCHECK(!flag.specified())
218 << "Given other flags, this flag should not have been specified: "
219 << flag_name;
220 }
221}
222
223// Gets the value from the flag if specified. Returns default if the
224// FlagRequirement is kUseDefault.

Callers

nothing calls this directly

Calls 1

specifiedMethod · 0.45

Tested by

no test coverage detected