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

Function CheckOptionalAttr

tensorflow/lite/toco/import_tensorflow.cc:141–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141tensorflow::Status CheckOptionalAttr(const NodeDef& node,
142 const string& attr_name,
143 const string& expected_value) {
144 if (HasAttr(node, attr_name)) {
145 const string& value = GetStringAttr(node, attr_name);
146 if (value != expected_value) {
147 return tensorflow::errors::InvalidArgument(
148 "Unexpected value for attribute '" + attr_name + "'. Expected '" +
149 expected_value + "'");
150 }
151 }
152 return tensorflow::Status::OK();
153}
154
155tensorflow::Status CheckOptionalAttr(
156 const NodeDef& node, const string& attr_name,

Callers 1

ConvertConvOperatorFunction · 0.85

Calls 4

HasAttrFunction · 0.85
GetStringAttrFunction · 0.85
InvalidArgumentFunction · 0.85
GetDataTypeAttrFunction · 0.85

Tested by

no test coverage detected