提交 0e250d51 编写于 作者: T tensor-tang

fix pool op test and bn op

上级 2b23e05f
......@@ -107,6 +107,8 @@ class TensorHvy : public TensorBase<TensorHvy> {
data_.Resize(framework::make_ddim(dims.Vectorize()));
}
void Resize(const std::vector<int64_t>& x) { Resize(DDimHvy(x)); }
void ShareDataWith(const TensorHvy& other) {
data_.ShareDataWith(other.data_);
}
......
......@@ -35,7 +35,7 @@ TEST(batch_norm_op_lite, test) {
scale->Resize({channel_size});
bias->Resize({channel_size});
mean->Resize({channel_size});
variance->Resize(DDim({channel_size}));
variance->Resize({channel_size});
// prepare op desc
cpp::OpDesc desc;
......
......@@ -74,7 +74,11 @@ TEST(pool_op_lite, test) {
pool.Attach(desc, &scope);
auto kernels = pool.CreateKernels({Place{TARGET(kARM), PRECISION(kFloat)}});
LOG(INFO) << "kernels.size(): " << kernels.size();
#ifdef LITE_WITH_ARM
ASSERT_FALSE(kernels.empty());
#else
ASSERT_TRUE(kernels.empty());
#endif
}
} // namespace operators
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册