提交 a4770bd7 编写于 作者: C chenjiaoAngel

fix clang ut build error

上级 82e4b53d
......@@ -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];
......
......@@ -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<T1>();
auto* out_ind_data = out_ind->mutable_data<T2>();
auto* out_val_data = out_val->template mutable_data<T1>();
auto* out_ind_data = out_ind->template mutable_data<T2>();
auto* x = scope->FindTensor(x_);
const auto* x_data = x->data<T1>();
const auto* x_data = x->template data<T1>();
int m = out_dims.production() / k_;
int n = x_dims_[x_dims_.size() - 1];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册