diff --git a/tensorflow/lite/toco/graph_transformations/tests/fuse_binary_into_following_affine_test.cc b/tensorflow/lite/toco/graph_transformations/tests/fuse_binary_into_following_affine_test.cc index 2cba6824cfb..d6cf31f4211 100644 --- a/tensorflow/lite/toco/graph_transformations/tests/fuse_binary_into_following_affine_test.cc +++ b/tensorflow/lite/toco/graph_transformations/tests/fuse_binary_into_following_affine_test.cc @@ -43,14 +43,15 @@ class FuseBinaryIntoFollowingAffineTest : public ::testing::Test { void SetUp() override { model_.reset(new Model); } - void CreateArray(const string& name, const std::vector& shape) { + void CreateArray(const std::string& name, const std::vector& shape) { Array& array = model_->GetOrCreateArray(name); array.data_type = ArrayDataType::kFloat; Shape* array_shape = array.mutable_shape(); *(array_shape->mutable_dims()) = shape; } - void CreateConstantArray(const string& name, const std::vector& shape, + void CreateConstantArray(const std::string& name, + const std::vector& shape, const std::vector& data) { CreateArray(name, shape); Array& array = model_->GetOrCreateArray(name); diff --git a/tensorflow/lite/toco/graph_transformations/tests/fuse_binary_into_preceding_affine_test.cc b/tensorflow/lite/toco/graph_transformations/tests/fuse_binary_into_preceding_affine_test.cc index b5c321c1a26..6c3dc7dc761 100644 --- a/tensorflow/lite/toco/graph_transformations/tests/fuse_binary_into_preceding_affine_test.cc +++ b/tensorflow/lite/toco/graph_transformations/tests/fuse_binary_into_preceding_affine_test.cc @@ -43,14 +43,15 @@ class FuseBinaryIntoPrecedingAffineTest : public ::testing::Test { void SetUp() override { model_.reset(new Model); } - void CreateArray(const string& name, const std::vector& shape) { + void CreateArray(const std::string& name, const std::vector& shape) { Array& array = model_->GetOrCreateArray(name); array.data_type = ArrayDataType::kFloat; Shape* array_shape = array.mutable_shape(); *(array_shape->mutable_dims()) = shape; } - void CreateConstantArray(const string& name, const std::vector& shape, + void CreateConstantArray(const std::string& name, + const std::vector& shape, const std::vector& data) { CreateArray(name, shape); Array& array = model_->GetOrCreateArray(name); diff --git a/tensorflow/lite/toco/graph_transformations/tests/lstm_utils_test.cc b/tensorflow/lite/toco/graph_transformations/tests/lstm_utils_test.cc index bdb27e8af2e..204e197e186 100644 --- a/tensorflow/lite/toco/graph_transformations/tests/lstm_utils_test.cc +++ b/tensorflow/lite/toco/graph_transformations/tests/lstm_utils_test.cc @@ -46,12 +46,12 @@ class CopyArrayDataTest : public ::testing::Test { int src_dim_1, int src_dim_2, std::initializer_list dst_data, int dst_dim_1, int dst_dim_2) { - string src_array = "src_array"; + std::string src_array = "src_array"; src_buffer_ = CreateFloatArrayBuffer( model, &src_array, src_dim_2 == 1 ? Shape({src_dim_1}) : Shape({src_dim_1, src_dim_2})); PopulateBuffer(src_buffer_, src_data); - string dst_array = "dst_array"; + std::string dst_array = "dst_array"; dst_buffer_ = CreateFloatArrayBuffer( model, &dst_array, dst_dim_2 == 1 ? Shape({dst_dim_1}) : Shape({dst_dim_1, dst_dim_2})); diff --git a/tensorflow/lite/toco/graph_transformations/tests/resolve_constant_concatenation_test.cc b/tensorflow/lite/toco/graph_transformations/tests/resolve_constant_concatenation_test.cc index bfed38ce7aa..5b0566fe074 100644 --- a/tensorflow/lite/toco/graph_transformations/tests/resolve_constant_concatenation_test.cc +++ b/tensorflow/lite/toco/graph_transformations/tests/resolve_constant_concatenation_test.cc @@ -107,10 +107,10 @@ class ResolveConstantConcatenationTest : public ::testing::Test { // together with 4 arrays as its inputs. // It receives the dimension of concatenation as input. void PrepareModel(Model* model, int axis) { - const string output_name("concat_op_output"); + const std::string output_name("concat_op_output"); model->flags.add_output_arrays(output_name); - std::vector concat_input_names = {"array0", "array1", "array2", - "array3"}; + std::vector concat_input_names = {"array0", "array1", "array2", + "array3"}; const int kDim = 3; const int kElementPerDim = 2; @@ -122,7 +122,7 @@ class ResolveConstantConcatenationTest : public ::testing::Test { {20., 21., 22., 23., 24., 25., 26., 27.}, {30., 31., 32., 33., 34., 35., 36., 37.}}; int cnt = 0; - for (const string& concat_input_name : concat_input_names) { + for (const std::string& concat_input_name : concat_input_names) { Array& in_array = model->GetOrCreateArray(concat_input_name); in_array.data_type = ArrayDataType::kFloat; diff --git a/tensorflow/lite/toco/graph_transformations/tests/unpack_quantize_test.cc b/tensorflow/lite/toco/graph_transformations/tests/unpack_quantize_test.cc index 2dc3fb35b0f..3cc4e725463 100755 --- a/tensorflow/lite/toco/graph_transformations/tests/unpack_quantize_test.cc +++ b/tensorflow/lite/toco/graph_transformations/tests/unpack_quantize_test.cc @@ -40,10 +40,11 @@ class UnpackQuantizeTest : public ::testing::Test { // 1. calculate min and max of the input. // 2. insert dequantization nodes after quantized outputs of Unpack operation. void PrepareModel(Model* model, int axis) { - std::vector unpack_output_names = {"unpack_out0", "unpack_out1"}; + std::vector unpack_output_names = {"unpack_out0", + "unpack_out1"}; model->flags.add_output_arrays(unpack_output_names[0]); model->flags.add_output_arrays(unpack_output_names[1]); - const string unpack_input_name("unpack_op_input"); + const std::string unpack_input_name("unpack_op_input"); const int kDim = 2; const int kElementPerDim = 2; @@ -75,7 +76,7 @@ class UnpackQuantizeTest : public ::testing::Test { // Configuring the necessary outputs. The outputs also happen to be in // kFloat. This is because during quantization transformation data types for // these arrays are going to be forced to be kUint8. - for (const string& unpack_output_name : unpack_output_names) { + for (const std::string& unpack_output_name : unpack_output_names) { Array& out_array = model->GetOrCreateArray(unpack_output_name); out_array.GetOrCreateMinMax(); out_array.data_type = ArrayDataType::kFloat; @@ -109,7 +110,7 @@ TEST_F(UnpackQuantizeTest, CheckUnpackPreservesQuantizationParameters) { ->Run(&model, /*op_index=*/0, &modified) .ok()); - const string output_name = model.flags.output_arrays(0); + const std::string output_name = model.flags.output_arrays(0); // Quantization transformation inserts NODE_NAME_DEQUANTIZE operations, // effectively making them the new outputs of the array. Old outputs of the