From 22648a321475eff971877de4f56637e074a5ee4d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Devansh=20Bansal/SNAP=20/SRI-Bangalore/Engineer/=EC=82=BC?= =?utf8?q?=EC=84=B1=EC=A0=84=EC=9E=90?= Date: Fri, 7 Dec 2018 06:21:47 +0530 Subject: [PATCH] Adding assertions in TransposeConv op. (#3887) This patch adds necessary assertions in TransposeConv. Signed-off-by: b.devansh --- runtimes/pure_arm_compute/src/compilation.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runtimes/pure_arm_compute/src/compilation.cc b/runtimes/pure_arm_compute/src/compilation.cc index b1092c4..f46ea12 100644 --- a/runtimes/pure_arm_compute/src/compilation.cc +++ b/runtimes/pure_arm_compute/src/compilation.cc @@ -3937,6 +3937,14 @@ void Planner::visit(const ::internal::tflite::op::TransposeConv::Node &node) const PaddingCode padding_type = static_cast(_ctx.at(padding_index).asScalar()); + assert(vstride > 0); + assert(hstride > 0); + assert((ANEURALNETWORKS_PADDING_SAME == padding_type) || + (ANEURALNETWORKS_PADDING_VALID == padding_type)); + assert(ifm_shape.N == ofm_shape.N); + assert(ifm_shape.C == ker_shape.C); + assert(ker_shape.N == ofm_shape.C); + // Set Shape Constraints and TensorInfo _builder.addShapeConstr( ifm_index, asTensorInfo(asTensorShape(_ctx.at(ifm_index).shape()), _ctx.at(ifm_index).type(), -- 2.7.4