From eb78c1d8e2eea4a901236914770289d729150802 Mon Sep 17 00:00:00 2001 From: jiaopu Date: Thu, 16 Apr 2020 13:53:07 +0800 Subject: [PATCH] CHECK some param --- lite/kernels/mlu/bridges/conv_op.cc | 3 +++ lite/kernels/mlu/bridges/dropout_op.cc | 2 ++ lite/kernels/mlu/bridges/pool_op.cc | 3 +++ 3 files changed, 8 insertions(+) diff --git a/lite/kernels/mlu/bridges/conv_op.cc b/lite/kernels/mlu/bridges/conv_op.cc index fc42b2a72a..1d0eedede6 100644 --- a/lite/kernels/mlu/bridges/conv_op.cc +++ b/lite/kernels/mlu/bridges/conv_op.cc @@ -50,6 +50,9 @@ int ConvConverter(void* ctx, OpLite* op, KernelBase* kernel) { CHECK_EQ(input_dims.size(), 4); CHECK_EQ(filter_dims.size(), 4); + CHECK(!(op_info->HasAttr("fuse_relu") && + (op_info->GetAttr("fuse_relu") == true))) + << "UnSupported param fuse_relu is true!"; const auto strides = op_info->GetAttr>("strides"); auto dilations = op_info->GetAttr>("dilations"); auto paddings = op_info->GetAttr>("paddings"); diff --git a/lite/kernels/mlu/bridges/dropout_op.cc b/lite/kernels/mlu/bridges/dropout_op.cc index 6a26696f50..6a3b528257 100644 --- a/lite/kernels/mlu/bridges/dropout_op.cc +++ b/lite/kernels/mlu/bridges/dropout_op.cc @@ -44,6 +44,8 @@ int DropoutConverter(void* ctx, OpLite* op, KernelBase* kernel) { // CHECK(is_test != true); // } + // Param fix_seed and seed is useless in MLU + auto dropout_implementation = op_info->GetAttr("dropout_implementation"); auto dropout_prob = op_info->GetAttr("dropout_prob"); diff --git a/lite/kernels/mlu/bridges/pool_op.cc b/lite/kernels/mlu/bridges/pool_op.cc index 2b0e838436..c734de1eec 100644 --- a/lite/kernels/mlu/bridges/pool_op.cc +++ b/lite/kernels/mlu/bridges/pool_op.cc @@ -55,6 +55,9 @@ int PoolConverter(void* ctx, OpLite* op, KernelBase* kernel) { auto global_pooling = op_info->GetAttr("global_pooling"); auto ksize = op_info->GetAttr>("ksize"); auto strides = op_info->GetAttr>("strides"); + CHECK(!(op_info->HasAttr("exclusive") && + op_info->GetAttr("exclusive") == false)) + << "Unsupport param exclusive is false!"; if (paddings.size() == 2L) { for (size_t i = 0; i < 2L; ++i) { -- GitLab