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

Function GetOperatorOptionName

tensorflow/compiler/mlir/lite/converter_gen.cc:61–72  ·  view source on GitHub ↗

Returns the associated option name for the given op definition.

Source from the content-addressed store, hash-verified

59
60// Returns the associated option name for the given op definition.
61static inline std::string GetOperatorOptionName(const Record &def) {
62 assert(def.getName().startswith("TFL_") && "unexpected op prefix");
63 assert(def.getName().endswith("Op") && "unexpected op suffix");
64
65 auto *custom_option = dyn_cast<StringInit>(def.getValueInit("customOption"));
66 std::ostringstream oss;
67 if (custom_option)
68 oss << custom_option->getValue().str();
69 else
70 oss << def.getName().drop_front(4).drop_back(2).str() << "Options";
71 return oss.str();
72}
73
74// Returns the builder function name for the given op definition.
75static inline std::string GetOperatorBuilderName(StringRef op_name) {

Callers 3

EmitOptionBuildersFunction · 0.70
EmitOperatorBuildersFunction · 0.70

Calls 1

getNameMethod · 0.45

Tested by

no test coverage detected