提交 efc3c5f4 编写于 作者: C chenjiaoAngel

fix ff.test=develoop

上级 60fa8386
...@@ -235,7 +235,8 @@ typedef paddle::lite::kernels::arm::DeformableConvCompute<PRECISION(kFloat), ...@@ -235,7 +235,8 @@ typedef paddle::lite::kernels::arm::DeformableConvCompute<PRECISION(kFloat),
PRECISION(kFloat)> PRECISION(kFloat)>
DeformableConvFp32; DeformableConvFp32;
REGISTER_LITE_KERNEL(deformable_conv, kARM, kFloat, kNCHW, DeformableConvFp32, def) REGISTER_LITE_KERNEL(
deformable_conv, kARM, kFloat, kNCHW, DeformableConvFp32, def)
.BindInput("Input", {LiteType::GetTensorTy(TARGET(kARM))}) .BindInput("Input", {LiteType::GetTensorTy(TARGET(kARM))})
.BindInput("Bias", {LiteType::GetTensorTy(TARGET(kARM))}) .BindInput("Bias", {LiteType::GetTensorTy(TARGET(kARM))})
.BindInput("Filter", {LiteType::GetTensorTy(TARGET(kARM))}) .BindInput("Filter", {LiteType::GetTensorTy(TARGET(kARM))})
......
...@@ -84,4 +84,5 @@ bool DeformableConvOpLite::InferShapeImpl() const { ...@@ -84,4 +84,5 @@ bool DeformableConvOpLite::InferShapeImpl() const {
} // namespace lite } // namespace lite
} // namespace paddle } // namespace paddle
REGISTER_LITE_OP(deformable_conv, paddle::lite::operators::DeformableConvOpLite); REGISTER_LITE_OP(deformable_conv,
paddle::lite::operators::DeformableConvOpLite);
...@@ -47,7 +47,7 @@ class GroupNormComputeTest : public arena::TestCase { ...@@ -47,7 +47,7 @@ class GroupNormComputeTest : public arena::TestCase {
dims_(dims), dims_(dims),
epsilon_(epsilon), epsilon_(epsilon),
groups_(groups), groups_(groups),
channels_(channels){} channels_(channels) {}
void RunBaseline(Scope* scope) override { void RunBaseline(Scope* scope) override {
auto x = scope->FindTensor(x_); auto x = scope->FindTensor(x_);
...@@ -108,8 +108,8 @@ class GroupNormComputeTest : public arena::TestCase { ...@@ -108,8 +108,8 @@ class GroupNormComputeTest : public arena::TestCase {
float* y_ch_ptr = y_ptr + c * in_size; float* y_ch_ptr = y_ptr + c * in_size;
for (int j = 0; j < in_size; j++) { for (int j = 0; j < in_size; j++) {
y_ch_ptr[j] = scale_val * (x_ch_ptr[j] - saved_mean_data[i]) * y_ch_ptr[j] = scale_val * (x_ch_ptr[j] - saved_mean_data[i]) *
saved_variance_data[i] + bias_val; saved_variance_data[i] +
// LOG(INFO) << "j: " << j << ", " << y_ch_ptr[j]; bias_val;
} }
} }
} }
...@@ -129,7 +129,6 @@ class GroupNormComputeTest : public arena::TestCase { ...@@ -129,7 +129,6 @@ class GroupNormComputeTest : public arena::TestCase {
} }
void PrepareData() override { void PrepareData() override {
LOG(INFO) << "dims_: " << dims_[0] << ", " << dims_[1] << ", " << dims_[2] << ", " << dims_[3];
std::vector<float> x(dims_.production()); std::vector<float> x(dims_.production());
fill_data_rand(x.data(), -1.f, 1.f, dims_.production()); fill_data_rand(x.data(), -1.f, 1.f, dims_.production());
...@@ -152,14 +151,14 @@ void TestGroupNorm(Place place, ...@@ -152,14 +151,14 @@ void TestGroupNorm(Place place,
for (auto& c : {1}) { for (auto& c : {1}) {
for (auto& h : {1, 16, 33, 56}) { for (auto& h : {1, 16, 33, 56}) {
for (auto& w : {1, 17, 55}) { for (auto& w : {1, 17, 55}) {
for (auto& groups: {1, 2, 4}) { for (auto& groups : {1, 2, 4}) {
if (c % groups != 0) { if (c % groups != 0) {
continue; continue;
} }
DDim dim_in({n, c, h, w}); DDim dim_in({n, c, h, w});
float epsilon = 1e-5f; float epsilon = 1e-5f;
std::unique_ptr<arena::TestCase> tester( std::unique_ptr<arena::TestCase> tester(new GroupNormComputeTest(
new GroupNormComputeTest(place, "def", dim_in, epsilon, groups, c)); place, "def", dim_in, epsilon, groups, c));
#ifdef LITE_WITH_ARM #ifdef LITE_WITH_ARM
if (place == TARGET(kARM)) { if (place == TARGET(kARM)) {
auto& ctx = tester->context()->As<ARMContext>(); auto& ctx = tester->context()->As<ARMContext>();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册