Update tensorflow/compiler/mlir/tensorflow/translate/export_graphdef.cc

Co-authored-by: Mihai Maruseac <mihai.maruseac@gmail.com>
This commit is contained in:
tg-at-google 2020-07-28 16:17:21 -04:00 committed by GitHub
parent ed1feb0c26
commit 6142a27972
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -519,11 +519,11 @@ StatusOr<std::unique_ptr<Graph>> Exporter::Convert(
llvm::StringMap<Operation*> name_to_op;
for (const auto& it : llvm::enumerate(graph_op.GetFetch().getOperands())) {
// Skip control rets.
const int64 it_index = it.index();
if (it_index >= num_data_results) break;
const int64 index = it.index();
if (index >= num_data_results) break;
// TODO(jpienaar): If there is a result index specified, ensure only one
// and that it matches the result index of the op.
std::string orig_name(output_names[it.index()]);
std::string orig_name(output_names[index]);
auto tensor_id = ParseTensorName(orig_name);
auto name = LegalizeNodeName(
llvm::StringRef(tensor_id.node().data(), tensor_id.node().size()));