| 563 | } |
| 564 | |
| 565 | void GetOutputNamesFromNodeDef(const NodeDef& node, |
| 566 | const tensorflow::OpDef& op_def, |
| 567 | TensorFlowUnsupportedOperator* op) { |
| 568 | int next_output = 0; |
| 569 | auto add_output = [&node, &next_output, op]() { |
| 570 | if (next_output == 0) { |
| 571 | op->outputs.push_back(node.name()); // Implicit :0. |
| 572 | } else { |
| 573 | op->outputs.push_back(absl::StrCat(node.name(), ":", next_output)); |
| 574 | } |
| 575 | ++next_output; |
| 576 | }; |
| 577 | for (int i = 0; i < op_def.output_arg_size(); ++i) { |
| 578 | string multiples = op_def.output_arg(i).number_attr(); |
| 579 | if (!multiples.empty()) { |
| 580 | CHECK(HasAttr(node, multiples)) << "No attr named " << multiples; |
| 581 | int num_outputs = GetIntAttr(node, multiples); |
| 582 | for (int j = 0; j < num_outputs; ++j) { |
| 583 | add_output(); |
| 584 | } |
| 585 | } else { |
| 586 | string list = op_def.output_arg(i).type_list_attr(); |
| 587 | if (!list.empty()) { |
| 588 | CHECK(HasAttr(node, list)) << "No attr named " << list; |
| 589 | const AttrValue::ListValue& list_value = GetListAttr(node, list); |
| 590 | for (int j = 0; j < list_value.type_size(); ++j) { |
| 591 | add_output(); |
| 592 | } |
| 593 | } else { |
| 594 | add_output(); |
| 595 | } |
| 596 | } |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | void GetOutputTypesFromNodeDef(const NodeDef& node, |
| 601 | const tensorflow::OpDef& op_def, |
no test coverage detected