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

Function HasOptionalAttrs

tensorflow/cc/framework/cc_op_gen.cc:505–517  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

503}
504
505bool HasOptionalAttrs(
506 const ApiDef& api_def,
507 const std::unordered_map<string, string>& inferred_input_attrs) {
508 for (int i = 0; i < api_def.attr_size(); ++i) {
509 const auto& attr(api_def.attr(i));
510 if ((inferred_input_attrs.find(attr.name()) ==
511 inferred_input_attrs.end()) &&
512 attr.has_default_value()) {
513 return true;
514 }
515 }
516 return false;
517}
518
519struct OpInfo {
520 // graph_op_def: The OpDef used by the runtime, has the names that

Callers 1

OpInfoMethod · 0.85

Calls 4

has_default_valueMethod · 0.80
nameMethod · 0.65
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected