diff --git a/src/common/types.cpp b/src/common/types.cpp index 7edfde6f857daad252fc8ef6174417e4f639d093..d1367dda2fe1029090593c3d85c2295ff57631c8 100644 --- a/src/common/types.cpp +++ b/src/common/types.cpp @@ -83,6 +83,8 @@ const char *G_OP_TYPE_LOGICAL_NOT = "logical_not"; const char *G_OP_TYPE_LOGICAL_XOR = "logical_xor"; const char *G_OP_TYPE_WRITE_TO_ARRAY = "write_to_array"; const char *G_OP_TYPE_READ_FROM_ARRAY = "read_from_array"; +const char *G_OP_TYPE_IS_EMPTY = "is_empty"; +const char *G_OP_TYPE_INCREMENT = "increment"; const char *G_OP_TYPE_QUANTIZE = "quantize"; const char *G_OP_TYPE_DEQUANTIZE = "dequantize"; @@ -193,5 +195,7 @@ std::unordered_map< {G_OP_TYPE_LOGICAL_XOR, {{"X", "Y"}, {"Out"}}}, {G_OP_TYPE_LOGICAL_NOT, {{"X"}, {"Out"}}}, {G_OP_TYPE_WRITE_TO_ARRAY, {{"X", "I"}, {"Out"}}}, - {G_OP_TYPE_READ_FROM_ARRAY, {{"X", "I"}, {"Out"}}}}; + {G_OP_TYPE_READ_FROM_ARRAY, {{"X", "I"}, {"Out"}}}, + {G_OP_TYPE_IS_EMPTY, {{"X"}, {"Out"}}}, + {G_OP_TYPE_INCREMENT, {{"X"}, {"Out"}}}}; } // namespace paddle_mobile diff --git a/src/common/types.h b/src/common/types.h index 31d8020d4d3a715683f08f0d27e5463f7865abcc..cc276788796883ad5ffe7346a5f7db6429cf6ea2 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -172,6 +172,8 @@ extern const char *G_OP_TYPE_LOGICAL_NOT; extern const char *G_OP_TYPE_LOGICAL_XOR; extern const char *G_OP_TYPE_WRITE_TO_ARRAY; extern const char *G_OP_TYPE_READ_FROM_ARRAY; +extern const char *G_OP_TYPE_IS_EMPTY; +extern const char *G_OP_TYPE_INCREMENT; extern const char *G_OP_TYPE_QUANTIZE; extern const char *G_OP_TYPE_DEQUANTIZE; diff --git a/src/framework/load_ops.h b/src/framework/load_ops.h index eadef7d6688291af2b44c686d78ba6b950abbbba..ce1381a60fb72b3177e08f91f369a8d7f95d68d1 100644 --- a/src/framework/load_ops.h +++ b/src/framework/load_ops.h @@ -306,3 +306,9 @@ LOAD_OP1(write_to_array, CPU); #ifdef READ_FROM_ARRAY_OP LOAD_OP1(read_from_array, CPU); #endif +#ifdef IS_EMPTY_OP +LOAD_OP1(is_empty, CPU); +#endif +#ifdef INCREMENT_OP +LOAD_OP1(increment, CPU); +#endif diff --git a/src/operators/increment_op.cpp b/src/operators/increment_op.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4b2cd0462e5392f20deb86231b02745458a83b3e --- /dev/null +++ b/src/operators/increment_op.cpp @@ -0,0 +1,48 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#ifdef INCREMENT_OP + +#include "operators/increment_op.h" +#include "framework/op_proto_maker.h" +#include "framework/op_registry.h" + +namespace paddle_mobile { +namespace operators { + +template +void IncrementOp::InferShape() const { + auto input = this->param_.InputX(); + auto out = this->param_.Out(); + PADDLE_MOBILE_ENFORCE(input->numel() == 1, "input's numel should be 1"); + out->Resize(input->dims()); + out->set_lod(input->lod()); +} + +} // namespace operators +} // namespace paddle_mobile + +namespace ops = paddle_mobile::operators; +#ifdef PADDLE_MOBILE_CPU +REGISTER_OPERATOR_CPU(increment, ops::IncrementOp); +#endif +#ifdef PADDLE_MOBILE_MALI_GPU +#endif +#ifdef PADDLE_MOBILE_FPGA +#endif + +#ifdef PADDLE_MOBILE_CL +#endif + +#endif diff --git a/src/operators/increment_op.h b/src/operators/increment_op.h new file mode 100644 index 0000000000000000000000000000000000000000..5212630cc4d01ca6d432f5e340d3cf0fd89782b5 --- /dev/null +++ b/src/operators/increment_op.h @@ -0,0 +1,49 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#ifdef INCREMENT_OP + +#pragma once + +#include +#include "framework/operator.h" +#include "operators/kernel/increment_kernel.h" +#include "operators/op_param.h" + +namespace paddle_mobile { +namespace operators { +using std::string; +template +class IncrementOp + : public framework::OperatorWithKernel, + IncrementKernel> { + public: + IncrementOp(const string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, + const framework::AttributeMap &attrs, + std::shared_ptr scope) + : framework::OperatorWithKernel, + IncrementKernel>( + type, inputs, outputs, attrs, scope) {} + + void InferShape() const override; + + protected: +}; + +} // namespace operators +} // namespace paddle_mobile + +#endif diff --git a/src/operators/is_empty_op.cpp b/src/operators/is_empty_op.cpp new file mode 100644 index 0000000000000000000000000000000000000000..654b998ebdfa6f6b0f40401a32ab5968c9dfeee1 --- /dev/null +++ b/src/operators/is_empty_op.cpp @@ -0,0 +1,45 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#ifdef IS_EMPTY_OP + +#include "operators/is_empty_op.h" +#include "framework/op_proto_maker.h" +#include "framework/op_registry.h" + +namespace paddle_mobile { +namespace operators { + +template +void IsEmptyOp::InferShape() const { + auto out = this->param_.Out(); + out->Resize({1}); +} + +} // namespace operators +} // namespace paddle_mobile + +namespace ops = paddle_mobile::operators; +#ifdef PADDLE_MOBILE_CPU +REGISTER_OPERATOR_CPU(is_empty, ops::IsEmptyOp); +#endif +#ifdef PADDLE_MOBILE_MALI_GPU +#endif +#ifdef PADDLE_MOBILE_FPGA +#endif + +#ifdef PADDLE_MOBILE_CL +#endif + +#endif diff --git a/src/operators/is_empty_op.h b/src/operators/is_empty_op.h new file mode 100644 index 0000000000000000000000000000000000000000..45af2646a7a8a2691868ea204a8602a34898412d --- /dev/null +++ b/src/operators/is_empty_op.h @@ -0,0 +1,48 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#ifdef IS_EMPTY_OP + +#pragma once + +#include +#include "framework/operator.h" +#include "operators/kernel/is_empty_kernel.h" +#include "operators/op_param.h" + +namespace paddle_mobile { +namespace operators { +using std::string; +template +class IsEmptyOp + : public framework::OperatorWithKernel, + IsEmptyKernel> { + public: + IsEmptyOp(const string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, + const framework::AttributeMap &attrs, + std::shared_ptr scope) + : framework::OperatorWithKernel, + IsEmptyKernel>( + type, inputs, outputs, attrs, scope) {} + + void InferShape() const override; + + protected: +}; + +} // namespace operators +} // namespace paddle_mobile + +#endif diff --git a/src/operators/kernel/arm/increment_kernel.cpp b/src/operators/kernel/arm/increment_kernel.cpp new file mode 100644 index 0000000000000000000000000000000000000000..27fd48d084a1c29289dd6e8755cee860208d12f7 --- /dev/null +++ b/src/operators/kernel/arm/increment_kernel.cpp @@ -0,0 +1,36 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#ifdef INCREMENT_OP + +#include "operators/kernel/increment_kernel.h" +#include + +namespace paddle_mobile { +namespace operators { + +template <> +bool IncrementKernel::Init(IncrementParam *param) { + return true; +} + +template <> +void IncrementKernel::Compute(const IncrementParam ¶m) { + IncrementCompute(param); +} + +} // namespace operators +} // namespace paddle_mobile + +#endif diff --git a/src/operators/kernel/arm/is_empty_kernel.cpp b/src/operators/kernel/arm/is_empty_kernel.cpp new file mode 100644 index 0000000000000000000000000000000000000000..070d3d16d7813584c490c868333d69a9a11afde9 --- /dev/null +++ b/src/operators/kernel/arm/is_empty_kernel.cpp @@ -0,0 +1,37 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#ifdef INCREMENT_OP + +#include "operators/kernel/is_empty_kernel.h" + +namespace paddle_mobile { +namespace operators { + +template <> +bool IsEmptyKernel::Init(IsEmptyParam *param) { + return true; +} + +template <> +void IsEmptyKernel::Compute(const IsEmptyParam ¶m) { + const framework::Tensor *input = param.InputX(); + framework::Tensor *out = param.Out(); + out->mutable_data()[0] = input->numel() == 0; +} + +} // namespace operators +} // namespace paddle_mobile + +#endif diff --git a/src/operators/kernel/central-arm-func/increment_arm_func.h b/src/operators/kernel/central-arm-func/increment_arm_func.h new file mode 100644 index 0000000000000000000000000000000000000000..44465b2a2f10ad0ca9cb2b6166d14429197a1e30 --- /dev/null +++ b/src/operators/kernel/central-arm-func/increment_arm_func.h @@ -0,0 +1,39 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#ifdef INCREMENT_OP + +#pragma once + +#include "operators/op_param.h" + +namespace paddle_mobile { +namespace operators { + +template +void IncrementCompute(const IncrementParam ¶m) { + const framework::Tensor *input = param.InputX(); + framework::Tensor *out = param.Out(); + int step = param.Step(); + + out->mutable_data

(); + const P *input_data = input->data

(); + P *out_data = out->data

(); + *out_data = *input_data + step; +} + +} // namespace operators +} // namespace paddle_mobile + +#endif diff --git a/src/operators/kernel/increment_kernel.h b/src/operators/kernel/increment_kernel.h new file mode 100644 index 0000000000000000000000000000000000000000..43a930c1b9be512714d253db0966ad171ba4068c --- /dev/null +++ b/src/operators/kernel/increment_kernel.h @@ -0,0 +1,36 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#ifdef INCREMENT_OP + +#pragma once + +#include "framework/operator.h" +#include "operators/op_param.h" + +namespace paddle_mobile { +namespace operators { + +template +class IncrementKernel + : public framework::OpKernelBase> { + public: + void Compute(const IncrementParam ¶m); + bool Init(IncrementParam *param); +}; + +} // namespace operators +} // namespace paddle_mobile + +#endif diff --git a/src/operators/kernel/is_empty_kernel.h b/src/operators/kernel/is_empty_kernel.h new file mode 100644 index 0000000000000000000000000000000000000000..0a6806d087b2bc06e2de77b9a133ad599ba9c3e5 --- /dev/null +++ b/src/operators/kernel/is_empty_kernel.h @@ -0,0 +1,36 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#ifdef IS_EMPTY_OP + +#pragma once + +#include "framework/operator.h" +#include "operators/op_param.h" + +namespace paddle_mobile { +namespace operators { + +template +class IsEmptyKernel + : public framework::OpKernelBase> { + public: + void Compute(const IsEmptyParam ¶m); + bool Init(IsEmptyParam *param); +}; + +} // namespace operators +} // namespace paddle_mobile + +#endif diff --git a/src/operators/op_param.h b/src/operators/op_param.h index d90dff2d7e919f736b5cfd0531074944938f2a8a..5a4627625c7b2e8f86a1012875c8f885118ed4c8 100644 --- a/src/operators/op_param.h +++ b/src/operators/op_param.h @@ -3070,5 +3070,52 @@ class ReadFromArrayParam : public OpParam { }; #endif +#ifdef IS_EMPTY_OP +template +class IsEmptyParam : public OpParam { + typedef typename DtypeTensorTrait::gtype GType; + typedef typename DtypeTensorTrait::rtype RType; + + public: + IsEmptyParam(const VariableNameMap &inputs, const VariableNameMap &outputs, + const AttributeMap &attrs, const Scope &scope) { + input_x_ = InputXFrom(inputs, scope); + output_ = OutFrom(outputs, scope); + } + + const GType *InputX() const { return input_x_; } + GType *Out() const { return output_; } + + public: + GType *input_x_; + GType *output_; +}; +#endif // IS_EMPTY_OP + +#ifdef INCREMENT_OP +template +class IncrementParam : public OpParam { + typedef typename DtypeTensorTrait::gtype GType; + typedef typename DtypeTensorTrait::rtype RType; + + public: + IncrementParam(const VariableNameMap &inputs, const VariableNameMap &outputs, + const AttributeMap &attrs, const Scope &scope) { + input_x_ = InputXFrom(inputs, scope); + output_ = OutFrom(outputs, scope); + step_ = OpParam::GetAttr("step", attrs); + } + + const GType *InputX() const { return input_x_; } + GType *Out() const { return output_; } + int Step() const { return step_; } + + public: + GType *input_x_; + GType *output_; + int step_; +}; +#endif // INCREMENT_OP + } // namespace operators } // namespace paddle_mobile diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 23634f33fe01dbfbc994f48a522c30c966fc7087..febc762889c21bb392a0f1e64c2ed415eabc6011 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -437,4 +437,12 @@ if (NOT FOUND_MATCH) ADD_EXECUTABLE(test-logical-xor-op operators/test_logical_xor_op.cpp test_helper.h test_include.h) target_link_libraries(test-logical-xor-op paddle-mobile) + # gen test + ADD_EXECUTABLE(test-increment-op operators/test_increment_op.cpp test_helper.h test_include.h) + target_link_libraries(test-increment-op paddle-mobile) + + # gen test + ADD_EXECUTABLE(test-is-empty-op operators/test_is_empty_op.cpp test_helper.h test_include.h) + target_link_libraries(test-is-empty-op paddle-mobile) + endif () diff --git a/test/operators/test_increment_op.cpp b/test/operators/test_increment_op.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bec564593878cc68bf7ea8628d38bf5567cfd331 --- /dev/null +++ b/test/operators/test_increment_op.cpp @@ -0,0 +1,75 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#include "../test_include.h" +#include "operators/increment_op.h" + +namespace paddle_mobile { + +template +void Increment(const framework::Tensor *input, framework::Tensor *out, + int step) { + auto input_data = input->data(); + auto out_data = out->data(); + *out_data = *input_data + step; +} + +int TestIncrementOp(const std::vector input_shape, int step) { + framework::DDim input_dims = framework::make_ddim(input_shape); + VariableNameMap inputs; + VariableNameMap outputs; + auto scope = std::make_shared(); + inputs["X"] = std::vector({"inputX"}); + outputs["Out"] = std::vector({"output"}); + + auto x_var = scope.get()->Var("inputX"); + auto x = x_var->template GetMutable(); + SetupTensor(x, input_dims, 0, 100); + + auto output_var = scope.get()->Var("output"); + framework::AttributeMap attrs; + attrs["step"].Set(step); + + auto *op = new operators::IncrementOp("increment", inputs, outputs, + attrs, scope); + + op->InferShape(); + op->Init(); + op->Run(); + + auto output = output_var->template Get(); + framework::Tensor output_cmp; + float *output_cmp_data = output_cmp.mutable_data(output->dims()); + Increment(x, &output_cmp, step); + + const float *output_data = output->data(); + for (int i = 0; i < output->numel(); ++i) { + float gap = output_data[i] - output_cmp_data[i]; + if (std::abs(gap / (output_data[i] + 1e-5)) > 1e-3) { + LOG(kLOG_INFO) << "output_data[" << i << "] = " << output_data[i] + << ", output_cmp_data[" << i + << "] = " << output_cmp_data[i]; + delete op; + exit(1); + } + } +} +} // namespace paddle_mobile + +int main() { + paddle_mobile::TestIncrementOp({1}, 4); + paddle_mobile::TestIncrementOp({1}, 10); + DLOG << "test increment op pass."; + return 0; +} diff --git a/test/operators/test_is_empty_op.cpp b/test/operators/test_is_empty_op.cpp new file mode 100644 index 0000000000000000000000000000000000000000..d5d5efd4b3627a50e2c74c82d31c8b7f229aea53 --- /dev/null +++ b/test/operators/test_is_empty_op.cpp @@ -0,0 +1,69 @@ +/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. */ + +#include "../test_include.h" +#include "operators/is_empty_op.h" + +namespace paddle_mobile { + +void IsEmpty(const framework::Tensor *input, framework::Tensor *out) { + out->data()[0] = input->numel() == 0; +} + +int TestIsEmptyOp(const std::vector input_shape) { + framework::DDim input_dims = framework::make_ddim(input_shape); + VariableNameMap inputs; + VariableNameMap outputs; + auto scope = std::make_shared(); + inputs["X"] = std::vector({"inputX"}); + outputs["Out"] = std::vector({"output"}); + + auto x_var = scope.get()->Var("inputX"); + auto x = x_var->template GetMutable(); + SetupTensor(x, input_dims, 0, 100); + + auto output_var = scope.get()->Var("output"); + framework::AttributeMap attrs; + + auto *op = new operators::IsEmptyOp("is_empty", inputs, outputs, + attrs, scope); + + op->InferShape(); + op->Init(); + op->Run(); + + auto output = output_var->template Get(); + framework::Tensor output_cmp; + bool *output_cmp_data = output_cmp.mutable_data(output->dims()); + IsEmpty(x, &output_cmp); + + const bool *output_data = output->data(); + for (int i = 0; i < output->numel(); ++i) { + if (output_data[i] != output_cmp_data[i]) { + LOG(kLOG_INFO) << "output_data[" << i << "] = " << output_data[i] + << ", output_cmp_data[" << i + << "] = " << output_cmp_data[i]; + delete op; + exit(1); + } + } +} +} // namespace paddle_mobile + +int main() { + paddle_mobile::TestIsEmptyOp({1, 3, 100, 100}); + paddle_mobile::TestIsEmptyOp({0}); + DLOG << "test is_empty op pass."; + return 0; +} diff --git a/tools/op.cmake b/tools/op.cmake index 65afb07054e107dfc29d27c7ce547f926b318df0..e5614385032895b207500d06cd77101581e51851 100644 --- a/tools/op.cmake +++ b/tools/op.cmake @@ -288,6 +288,8 @@ if(NOT FOUND_MATCH) set(WHILE_OP ON) set(WRITE_TO_ARRAY_OP ON) set(READ_FROM_ARRAY_OP ON) + set(IS_EMPTY_OP ON) + set(INCREMENT_OP ON) endif() # option(BATCHNORM_OP "" ON) @@ -572,3 +574,9 @@ endif() if (READ_FROM_ARRAY_OP) add_definitions(-DREAD_FROM_ARRAY_OP) endif() +if (IS_EMPTY_OP) + add_definitions(-DIS_EMPTY_OP) +endif() +if (INCREMENT_OP) + add_definitions(-DINCREMENT_OP) +endif() \ No newline at end of file