diff --git a/paddle/fluid/lite/core/hvy_tensor.h b/paddle/fluid/lite/core/hvy_tensor.h index 16172a80035e6512244f0bccd91ff2f5d2553f0d..748e80c2559718d278a08e3c568532e177c835eb 100644 --- a/paddle/fluid/lite/core/hvy_tensor.h +++ b/paddle/fluid/lite/core/hvy_tensor.h @@ -107,6 +107,8 @@ class TensorHvy : public TensorBase { data_.Resize(framework::make_ddim(dims.Vectorize())); } + void Resize(const std::vector& x) { Resize(DDimHvy(x)); } + void ShareDataWith(const TensorHvy& other) { data_.ShareDataWith(other.data_); } diff --git a/paddle/fluid/lite/operators/batch_norm_op_test.cc b/paddle/fluid/lite/operators/batch_norm_op_test.cc index f5449e7ec19f1bfdcc3f11a7fdac65dcfbc9af17..b91c367d92b721c1f96fd5fc92ec0b4f877408e4 100644 --- a/paddle/fluid/lite/operators/batch_norm_op_test.cc +++ b/paddle/fluid/lite/operators/batch_norm_op_test.cc @@ -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; diff --git a/paddle/fluid/lite/operators/pool_op_test.cc b/paddle/fluid/lite/operators/pool_op_test.cc index bf46a2ecbd8a465fa5a52bc099389ff3838a5840..9ab2865f1d04f2ca173b9d2f5f7d9e457f6754e8 100644 --- a/paddle/fluid/lite/operators/pool_op_test.cc +++ b/paddle/fluid/lite/operators/pool_op_test.cc @@ -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