diff --git a/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc b/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc index 4bc61240a7e..8fc16c6f745 100644 --- a/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc +++ b/tensorflow/compiler/tf2tensorrt/convert/convert_nodes.cc @@ -214,8 +214,8 @@ inline nvinfer1::Dims TensorShapeToTrtDims(const TensorShapeType& shape, return trt_dims; } -Status TensorShapeArrayToTrtDims(const std::vector& shape, - nvinfer1::Dims* out, +template +Status TensorShapeArrayToTrtDims(const Container& shape, nvinfer1::Dims* out, bool ignore_first_dim = false) { PartialTensorShape tensor_shape; TF_RETURN_IF_ERROR(TensorShapeUtils::MakeShape(shape, &tensor_shape)); @@ -2354,7 +2354,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 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)); } }