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

Function GetAttrToInputsMap

tensorflow/python/eager/pywrap_tfe_src.cc:70–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68}
69
70AttrToInputsMap* GetAttrToInputsMap(const tensorflow::OpDef& op_def) {
71 tensorflow::mutex_lock l(all_attr_to_input_maps_lock);
72 auto* all_attr_to_input_maps = GetAllAttrToInputsMaps();
73
74 auto* output =
75 tensorflow::gtl::FindPtrOrNull(*all_attr_to_input_maps, op_def.name());
76 if (output != nullptr) {
77 return output;
78 }
79
80 std::unique_ptr<AttrToInputsMap> m(new AttrToInputsMap);
81
82 // Store a list of InputIndex -> List of corresponding inputs.
83 for (int i = 0; i < op_def.input_arg_size(); i++) {
84 if (!op_def.input_arg(i).type_attr().empty()) {
85 auto it = m->find(op_def.input_arg(i).type_attr());
86 if (it == m->end()) {
87 it = m->insert({op_def.input_arg(i).type_attr(), {}}).first;
88 }
89 it->second.emplace_back(i, !op_def.input_arg(i).number_attr().empty());
90 }
91 }
92
93 auto* retval = m.get();
94 (*all_attr_to_input_maps)[op_def.name()] = m.release();
95
96 return retval;
97}
98
99struct FastPathOpExecInfo {
100 TFE_Context* ctx;

Callers 1

TFE_Py_FastPathExecute_CFunction · 0.85

Calls 10

GetAllAttrToInputsMapsFunction · 0.85
FindPtrOrNullFunction · 0.85
nameMethod · 0.65
emptyMethod · 0.45
findMethod · 0.45
endMethod · 0.45
insertMethod · 0.45
emplace_backMethod · 0.45
getMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected