From a4770bd7869ebd54d896cf1fd4183c293d1acafc Mon Sep 17 00:00:00 2001 From: chenjiaoAngel Date: Fri, 17 Apr 2020 06:55:04 -0400 Subject: [PATCH] fix clang ut build error --- lite/tests/kernels/compare_compute_test.cc | 6 +++--- lite/tests/kernels/logical_compute_test.cc | 6 +++--- lite/tests/kernels/lookup_table_compute_test.cc | 6 +++--- lite/tests/kernels/topk_compute_test.cc | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/lite/tests/kernels/compare_compute_test.cc b/lite/tests/kernels/compare_compute_test.cc index fbea52ab0d..c46718f8bf 100644 --- a/lite/tests/kernels/compare_compute_test.cc +++ b/lite/tests/kernels/compare_compute_test.cc @@ -78,12 +78,12 @@ class CompareComputeTester : public arena::TestCase { auto* out = scope->NewTensor(out_); CHECK(out); out->Resize(x_dims_); - auto* out_data = out->mutable_data(); + auto* out_data = out->template mutable_data(); auto axis = axis_; auto* x = scope->FindTensor(x_); - const auto* x_data = x->data(); + const auto* x_data = x->template data(); auto* y = scope->FindTensor(y_); - auto* y_data_in = y->data(); + auto* y_data_in = y->template data(); using CompareFunc = Functor; if (x_dims_.size() == y_dims_.size()) { diff --git a/lite/tests/kernels/logical_compute_test.cc b/lite/tests/kernels/logical_compute_test.cc index f56b81d57a..4e379c0a9c 100644 --- a/lite/tests/kernels/logical_compute_test.cc +++ b/lite/tests/kernels/logical_compute_test.cc @@ -55,17 +55,17 @@ class LogicalTester : public arena::TestCase { void RunBaseline(Scope* scope) override { auto* x = scope->FindTensor(x_); - const bool* x_data = x->data(); + const bool* x_data = x->template data(); const Tensor* y = nullptr; const bool* y_data = nullptr; if (op_type_ != "logical_not") { y = scope->FindTensor(y_); - y_data = y->data(); + y_data = y->template data(); } auto* out = scope->NewTensor(out_); out->Resize(dims_); - bool* out_data = out->mutable_data(); + bool* out_data = out->template mutable_data(); for (int i = 0; i < dims_.production(); i++) { bool y_tmp = (y_data == nullptr) ? true : y_data[i]; out_data[i] = Functor()(x_data[i], y_tmp); diff --git a/lite/tests/kernels/lookup_table_compute_test.cc b/lite/tests/kernels/lookup_table_compute_test.cc index c4f9277d86..988077c6c3 100644 --- a/lite/tests/kernels/lookup_table_compute_test.cc +++ b/lite/tests/kernels/lookup_table_compute_test.cc @@ -65,12 +65,12 @@ class LookupTableComputeTest : public arena::TestCase { out->Resize(out_dims); out->set_lod(ids->lod()); - auto ids_data = ids->data(); + auto ids_data = ids->template data(); auto ids_size = ids_dims.production(); - auto w_data = w->data(); + auto w_data = w->template data(); auto w_rows = w_dims[0]; auto w_cols = w_dims[1]; - auto out_data = out->mutable_data(); + auto out_data = out->template mutable_data(); for (int64_t i = 0; i < ids_size; i++) { auto id = ids_data[i]; diff --git a/lite/tests/kernels/topk_compute_test.cc b/lite/tests/kernels/topk_compute_test.cc index 699dd000fd..c54d297518 100644 --- a/lite/tests/kernels/topk_compute_test.cc +++ b/lite/tests/kernels/topk_compute_test.cc @@ -50,11 +50,11 @@ class TopkComputeTester : public arena::TestCase { out_dims[out_dims.size() - 1] = k_; out_val->Resize(out_dims); out_ind->Resize(out_dims); - auto* out_val_data = out_val->mutable_data(); - auto* out_ind_data = out_ind->mutable_data(); + auto* out_val_data = out_val->template mutable_data(); + auto* out_ind_data = out_ind->template mutable_data(); auto* x = scope->FindTensor(x_); - const auto* x_data = x->data(); + const auto* x_data = x->template data(); int m = out_dims.production() / k_; int n = x_dims_[x_dims_.size() - 1]; -- GitLab