未验证 提交 9cc77518 编写于 作者: H HappyAngel 提交者: GitHub

[arm] fix build clang unitest error (#3431)

fix clang build error
上级 a98dbcc1
......@@ -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<bool>();
auto* out_data = out->template mutable_data<bool>();
auto axis = axis_;
auto* x = scope->FindTensor(x_);
const auto* x_data = x->data<T>();
const auto* x_data = x->template data<T>();
auto* y = scope->FindTensor(y_);
auto* y_data_in = y->data<T>();
auto* y_data_in = y->template data<T>();
using CompareFunc = Functor<T>;
if (x_dims_.size() == y_dims_.size()) {
......
......@@ -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<bool>();
const bool* x_data = x->template data<bool>();
const Tensor* y = nullptr;
const bool* y_data = nullptr;
if (op_type_ != "logical_not") {
y = scope->FindTensor(y_);
y_data = y->data<bool>();
y_data = y->template data<bool>();
}
auto* out = scope->NewTensor(out_);
out->Resize(dims_);
bool* out_data = out->mutable_data<bool>();
bool* out_data = out->template mutable_data<bool>();
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);
......
......@@ -65,12 +65,12 @@ class LookupTableComputeTest : public arena::TestCase {
out->Resize(out_dims);
out->set_lod(ids->lod());
auto ids_data = ids->data<T>();
auto ids_data = ids->template data<T>();
auto ids_size = ids_dims.production();
auto w_data = w->data<float>();
auto w_data = w->template data<float>();
auto w_rows = w_dims[0];
auto w_cols = w_dims[1];
auto out_data = out->mutable_data<float>();
auto out_data = out->template mutable_data<float>();
for (int64_t i = 0; i < ids_size; i++) {
auto id = ids_data[i];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册