| 1097 | } |
| 1098 | |
| 1099 | int TF_OperationOutputListLength(TF_Operation* oper, const char* arg_name, |
| 1100 | TF_Status* status) { |
| 1101 | NameRangeMap name_ranges; |
| 1102 | status->status = |
| 1103 | NameRangesForNode(oper->node, oper->node.op_def(), nullptr, &name_ranges); |
| 1104 | if (TF_GetCode(status) != TF_OK) return -1; |
| 1105 | auto iter = name_ranges.find(arg_name); |
| 1106 | if (iter == name_ranges.end()) { |
| 1107 | status->status = InvalidArgument("Output arg '", arg_name, "' not found"); |
| 1108 | return -1; |
| 1109 | } |
| 1110 | return iter->second.second - iter->second.first; |
| 1111 | } |
| 1112 | |
| 1113 | int TF_OperationNumInputs(TF_Operation* oper) { |
| 1114 | return oper->node.num_inputs(); |