From 0a9195cc36a3647966f320610cf1b5b107f4c9c7 Mon Sep 17 00:00:00 2001 From: Trevor Morris Date: Wed, 27 Mar 2019 11:19:49 -0700 Subject: [PATCH 1/2] Fix type mismatch crash in CombinedNMS test. Fix compilation error due to absl::InlinedVector --- tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc | 3 ++- tensorflow/compiler/tf2tensorrt/convert/convert_nodes_test.cc | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc b/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc index 4bc61240a7e..a72702ea8ca 100644 --- a/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc +++ b/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc @@ -214,7 +214,8 @@ inline nvinfer1::Dims TensorShapeToTrtDims(const TensorShapeType& shape, return trt_dims; } -Status TensorShapeArrayToTrtDims(const std::vector& shape, +template +Status TensorShapeArrayToTrtDims(const Container& shape, nvinfer1::Dims* out, bool ignore_first_dim = false) { PartialTensorShape tensor_shape; diff --git a/tensorflow/compiler/tf2tensorrt/convert/convert_nodes_test.cc b/tensorflow/compiler/tf2tensorrt/convert/convert_nodes_test.cc index ab5dadcd6b1..4599d0c168a 100644 --- a/tensorflow/compiler/tf2tensorrt/convert/convert_nodes_test.cc +++ b/tensorflow/compiler/tf2tensorrt/convert/convert_nodes_test.cc @@ -2427,7 +2427,7 @@ TEST_F(OpConverterTest, ConvertCombinedNMS) { ElementsAre(0, 0, 0.3, 0.4, 0, 0, 0.3, 0.4)); EXPECT_THAT(GetSpanForData(output_data[1]), ElementsAre(0.7, 0.4)); EXPECT_THAT(GetSpanForData(output_data[2]), ElementsAre(1, 0)); - EXPECT_THAT(GetSpanForData(output_data[3]), ElementsAre(2)); + EXPECT_THAT(GetSpanForData(output_data[3]), ElementsAre(2)); } } From 0c39c30aeb39d877a547c4dfb01d6d567c5ebbf0 Mon Sep 17 00:00:00 2001 From: Trevor Morris Date: Wed, 27 Mar 2019 11:22:15 -0700 Subject: [PATCH 2/2] Fix use of ISliceLayer --- tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc b/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc index a72702ea8ca..1d1b4e360cc 100644 --- a/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc +++ b/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc @@ -2355,7 +2355,7 @@ Status ConvertStridedSliceHelper(OpConverterParams* params, if (params->validation_only) return Status::OK(); nvinfer1::ISliceLayer* layer = params->converter->network()->addSlice( - input.tensor(), begin_dims, size_dims, stride_dims); + *input.tensor(), begin_dims, size_dims, stride_dims); params->outputs->push_back(TRT_TensorOrWeights(layer->getOutput(0))); return Status::OK(); #else