From cdf8d99080c1c36c505cd5dbe7572fe2f71bac6d Mon Sep 17 00:00:00 2001 From: hedaoyuan Date: Wed, 28 Jun 2017 16:26:16 +0800 Subject: [PATCH] Bug fix. --- paddle/function/nnpack/NNPACKConvOp.cpp | 4 ++-- paddle/function/nnpack/NNPACKConvOpTest.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/paddle/function/nnpack/NNPACKConvOp.cpp b/paddle/function/nnpack/NNPACKConvOp.cpp index 5e4de55469d..d75fab04033 100644 --- a/paddle/function/nnpack/NNPACKConvOp.cpp +++ b/paddle/function/nnpack/NNPACKConvOp.cpp @@ -74,9 +74,9 @@ public: virtual void check(const BufferArgs& inputs, const BufferArgs& outputs) override { - const TensorShape& output = inputs[0].shape(); + const TensorShape& input = inputs[0].shape(); const TensorShape& filter = inputs[1].shape(); - const TensorShape& input = outputs[0].shape(); + const TensorShape& output = outputs[0].shape(); checkShape(input, filter, output); } diff --git a/paddle/function/nnpack/NNPACKConvOpTest.cpp b/paddle/function/nnpack/NNPACKConvOpTest.cpp index e7ce61cc6c4..48180112111 100644 --- a/paddle/function/nnpack/NNPACKConvOpTest.cpp +++ b/paddle/function/nnpack/NNPACKConvOpTest.cpp @@ -60,12 +60,15 @@ public: << " outputWidth=" << outputSize << " stride=" << stride << " padding=" << padding; + std::vector paddings = {padding, padding}; + std::vector strides = {stride, stride}; Compare2Function test( conv1, conv2, FuncConfig() - .set("padding", padding) - .set("stride", stride) + .set("paddings", paddings) + .set("strides", strides) + .set("groups", (size_t)1) .set("algo", algo)); TensorShape shape0{ -- GitLab