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

Method GetOpIdFor

tensorflow/core/kernels/hexagon/hexagon_ops_definitions.cc:385–407  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385int HexagonOpsDefinitions::GetOpIdFor(const string& op_type,
386 const DataTypeVector& dt_vec) const {
387 if (op_name_to_soc_op_type_map_.count(op_type) > 0) {
388 const std::vector<DataTypeToOp>& dt_to_op_vec =
389 op_name_to_soc_op_type_map_.at(op_type);
390 CHECK(!dt_to_op_vec.empty());
391 // If argument DataType is empty, return the first entry.
392 if (dt_vec.empty()) {
393 return static_cast<int>(std::get<1>(dt_to_op_vec.front()));
394 }
395 // If there is only one op_id registered for empty op_vec, we assume
396 // that the op supports any data types.
397 if (dt_to_op_vec.size() == 1 && std::get<0>(dt_to_op_vec.front()).empty()) {
398 return static_cast<int>(std::get<1>(dt_to_op_vec.front()));
399 }
400 for (const DataTypeToOp& data_type_to_op : dt_to_op_vec) {
401 if (std::get<0>(data_type_to_op) == dt_vec) {
402 return static_cast<int>(std::get<1>(data_type_to_op));
403 }
404 }
405 }
406 return IRemoteFusedGraphOpsDefinitions::INVALID_OP_ID;
407}
408} // namespace tensorflow

Callers 10

CheckOpsSupportFunction · 0.45
SetupGraphMethod · 0.45
RegisterNodeMethod · 0.45
RegisterNodeWithRankMethod · 0.45
RegisterPadNodeMethod · 0.45
RegisterInputNodeMethod · 0.45
RegisterFlattenNodeMethod · 0.45
RegisterGenericNodeMethod · 0.45

Calls 5

countMethod · 0.45
atMethod · 0.45
emptyMethod · 0.45
frontMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected