From e8d171bbd2a0680425ab0512f9019bfb0d7d6a70 Mon Sep 17 00:00:00 2001 From: xzl Date: Fri, 21 Jul 2017 10:33:28 +0800 Subject: [PATCH] add check for groups and inputChannels --- paddle/function/DepthwiseConvOp.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/paddle/function/DepthwiseConvOp.cpp b/paddle/function/DepthwiseConvOp.cpp index 9180c19b118..21084bedb44 100644 --- a/paddle/function/DepthwiseConvOp.cpp +++ b/paddle/function/DepthwiseConvOp.cpp @@ -125,6 +125,7 @@ public: size_t outputHeight = output[2]; size_t outputWidth = output[3]; size_t filterMultiplier = outputChannels / groups_; + CHECK_EQ(inputChannels, groups_); real* inputData = inputs[0].data(); real* filterData = inputs[1].data(); @@ -187,6 +188,7 @@ public: size_t outputHeight = output[2]; size_t outputWidth = output[3]; size_t filterMultiplier = outputChannels / groups_; + CHECK_EQ(inputChannels, groups_); real* outputGrad = inputs[0].data(); real* filterData = inputs[1].data(); @@ -248,6 +250,7 @@ public: size_t outputHeight = output[2]; size_t outputWidth = output[3]; size_t filterMultiplier = outputChannels / groups_; + CHECK_EQ(inputChannels, groups_); real* outputGrad = inputs[0].data(); real* inputData = inputs[1].data(); -- GitLab