diff --git a/doc/design_doc.md b/doc/design_doc.md new file mode 100644 index 0000000000000000000000000000000000000000..3ab649236dcb93fd9181d424870a87fec418448d --- /dev/null +++ b/doc/design_doc.md @@ -0,0 +1,181 @@ +# paddle-mobile 设计文档 + + +#### 以下是 paddle-mobile 代码的执行流程图: + +![执行流程图](./images/flow_chart.png "执行流程图") + + + +#### 主要分为: Loader 模块、 Program 模块、 Executor 模块、 op 模块、 kernel 模块、scope variable Tensor 模块 + +#### 下面展开说一下各个模块的作用以及设计思路 + +### 一. Loader +先来看一下模型, 模型分为两种结构: + 一种为参数文件是散开的, 如下图, 红框为模型结构的 protobuf 文件, 其余为参数文件 + +![模型描述](./images/model_desc.png "模型描述") + +另一种为参数文件结合在一起的, 如下图, 红框内为模型结构描述的 protobuf 文件, 另一个文件为结合在一起的参数文件 + +![模型描述combined](./images/model_desc_combined.png "模型描述combined") + +loader 模块的作用是将模型结构信息 load 进内存, 将红框内的 protobuf 文件 load 进内存, 并对模型结构进行优化(如将几个细粒度的 op 融合成 粗粒度的 op, 如将 conv、 add、 batchnorm、 relu 融合为 conv\_add\_batchnorm\_relu). +方便进行算法优化. + +__那么为什么融合在一起能够做算法优化 ?__ + +如果未融合的 conv add batchnorm relu 运算是这样的 + +``` +[n] +[conv_res] = conv([n]) + +for &res in conv_res { + res = add_biase(res) +} + +for &res in conv_res { + res = batchnorm(res) +} + +for &res in conv_res { + res = relu(res) +} + +``` +融合后的 conv\_add\_batchnorm\_relu 运算是这样的: + +``` +[n] +[conv_res] = conv([n]) + +for &res in conv_res { + res = relu(batchnorm(add_biase(res))) +} + +``` +由于 conv 可以转换为两个大矩阵相乘, 更进一步可以分为若干个一行一列的小矩阵相乘, 那最终的运算是这样的: + +``` +[n] +for &res in [res] { + res = relu(batchnorm(add_biase(A * B))) +} + +其中 A 和 B 为 1 * k 和 k * 1 矩阵 + +``` + + + +### 二. Program + +program 为 loader 模块的结果, 包含了优化前的模型结构对象, 以及优化后的模型结构对象, 此模块基本对应着 paddle 模型的结构, 关于paddle 模型的一些概念的定义, 详细设计可以参考 [program.md](https://github.com/PaddlePaddle/Paddle/blob/develop/doc/fluid/design/concepts/program.md), 以下是一个简单的概况: + +* programDesc 中包含着若干个(googlenet mobilenet yolo squeezenet resnet 常见的模型只有一个)可以嵌套的 block, blocks中的第一个block中的某个 op 可能会执行 blocks 中后边 block 中的一系列 op 运算(只有多个block才会有此概念) +* block 包含着 ops 和 vars +* ops 为一系列 op 的描述, 描述着每个 op 的类型, 输入输出, 所需参数 +* vars 里包含的为所有 op 运算所需的参数描述 + +### 三. Executor + +executor 主要是用于 op 运算的上层调度操作, 主要有两个操作, executor 实例化 和 暴露给上层的 predict 方法 + +* executor 实例化过程中, 主要进行了这几个操作 + 1. 根据 loader 产出的 program 初始化 operator 对象 + 2. 分配所有需要用到的内存, 包括每个op 的输入输出, 权重参数, 目前模型的权重参数文件的内存格式为 NCHW, op 的输入输出中间矩阵参数也是 NCHW 格式 + 3. 调用每个 op 的 init 方法, init 方法是每个 op 实现者进行参数预处理的地方, 有助于减少 predict 的耗时 + +* predict, 主要用于拿到外部的输入, 顺序调用 op 的 run 方法进行运算, 并返回最终的结果. + + +### 四. op +关于 op 模块代码的详细设计可以参考 [operator部分代码设计](https://github.com/PaddlePaddle/paddle-mobile/issues/300), operator主要包含一个kernel用于运算、一个 param 用于存储属性, operator 主要有三个操作, Init、RunImp、InferShape + +* Init: Init 函数主要用于参数预处理, 如对 batchNorm 参数进行预处理, 可以将 batchNorm 运算转化为 a * x + b 形式的运算, 这个函数也会调用, kernel 的 Init 函数对 kernel 进行初始化 +* RunImp: RunImp 函数会调用自己的kernel 的 compute 方法进行运算 +* InferShape: InferShape 函数会根据输入和参数得出输出的形状, 这个函数会在 executor 实例化时, 内存初始化前调用 + +每个 operator 都需要进行注册才可以被使用, 以 conv 为例, 需在 conv_op.cpp 底部这样写: + +```c++ +// 三个平台都注册了 conv op +namespace ops = paddle_mobile::operators; +#ifdef PADDLE_MOBILE_CPU +USE_OP_CPU(conv2d); +REGISTER_OPERATOR_CPU(conv2d, ops::ConvOp); +#endif + +#ifdef PADDLE_MOBILE_MALI_GPU +USE_OP_MALI_GPU(conv2d); +REGISTER_OPERATOR_MALI_GPU(conv2d, ops::ConvOp); +#endif + +#ifdef PADDLE_MOBILE_FPGA +USE_OP_FPGA(conv2d); +REGISTER_OPERATOR_FPGA(conv2d, ops::ConvOp); +#endif + +``` + +__一个关于包大小的优化__: + +每个 operator 都由一个宏控制编译, 如 conv_op.h(除了 conv_op.h , conv_op.cpp、conv_kernle.h、conv_kernle.cpp 也都需要加此宏控制) + +```c++ + +#ifdef CONV_OP //这个宏控制着 conv_op 是否被编译, 除了 conv_op.h , conv_op.cpp、conv_kernle.h conv_kernle.cpp 也都需要加此宏控制 + +#pragma once + +#include +#include "framework/operator.h" +#include "operators/kernel/conv_kernel.h" + +namespace paddle_mobile { +namespace operators { +using std::string; +template +class ConvOp + //impl +}; + +} // namespace operators +} // namespace paddle_mobile + +#endif + +``` +这样做的目的是为了根据不同类型的网络编译特定的op, 在 cmake 中已经配置好不同网络编译的宏, 如果你要进行编译支持 yolo 的模型, 仅需执行: + +```sh +cd toools +sh build.sh android yolo + +``` +这样只会编译 yolo 所包含的四种 op, 极大的减小了包体积和编译时间 + +### 五. kernel +kernel 为 op 的底层运算实现, 主要有两个函数, Init 和 Compute, 分别用来初始化、预处理 和 运算操作, 值得提出的是, kernel 会根据泛型特化到不同的平台, 如图所示: + +![设备特化](./images/devices.png "设备特化") + +不同平台的 kernel 实现, 为同一个 kernel 类不同泛型的特化实现, 目前有三个平台, arm、mali、fpga, 图中的 central-arm-func\ 目录为 op kernel 的 arm 实现, 它承担了 arm\ 目录下 kernel 的底层实现, 同时 arm 处理器作为中央处理器, central-arm-func\ 也可以作为其他协处理器的底层实现, 如: fpga 的某一个 op kernel 还没有 fpga 协处理器的实现, 就可以直接调用使用这里的 arm 实现. + +__如果你有兴趣新增一个协处理器实现, 就可以在次添加一个 kernel 目录, 提供协处理器实现, 如果某个 kernel 你没有实现完, 你也可以直接使用 arm 实现__ + +### 六. scope variable Tensor +* scope 用来存储管理所需用到的所有 variable(用来存储不同类型的对象, 主要是矩阵Tensor, 也就是说 scpoe 管理着 op 运算过程中所有参数矩阵, 输入输出矩阵), 可以将 scope 理解为一个 map, 这里在 map 上封了一层 scope 的概念是为了方便内存管理 +* variable 可以用来存储不同类型的对象, paddle-mobile 里主要用它来存储矩阵 Tensor +* tensor 代表着矩阵, 通过泛型可以用来存储不同类型的矩阵, 但需要注意的是, 存入和取出时的类型必须保持一致, 如果类型不一致, 使用 inline const T \*data() const 获取指针会不能通过类型检查, 通过 inline T \*mutable_data() 获取指针会重新分配内存, 以下是关于 Tensor 的一些小概念: + 1. DDim: 用来存储矩阵的维度信息. + 2. Slice(): 这个函数用来获取 N 维 (NCHW中的 N) 上切片 + 3. 当实例化未分配内存时, 调用 inline T *mutable_data() 会分配内存 + + + + + + diff --git a/doc/development_doc.md b/doc/development_doc.md new file mode 100644 index 0000000000000000000000000000000000000000..5673e043bda80e414d7e841928283764bd2b310e --- /dev/null +++ b/doc/development_doc.md @@ -0,0 +1,85 @@ +# iOS开发文档 + +## 编译 + +### 一. 使用 build.sh 编译 + +```sh +sh build.sh ios + +# 如果只想编译某个特定模型的 op, 则需执行以下命令 +sh build.sh ios googlenet + +# 在这个文件夹下, 你可以拿到生成的 .a 库 +cd ../build/release/ios/build + +``` + +### 二. 使用 xcode 编译 + +我们提供了 ios 开发更为熟悉的 xcode 编译环境: +在 ios/ 目录下打开 PaddleMobile.xcworkspace 即可编译 PaddleMobile 或者 运行 Demo + +### 三. 集成 + +#### 如使用 c++ 接口 +将 + +``` +libpaddle-mobile.a +io.h +program.h +types.h +lod_tensor.h +tensor.h +``` +拖入工程, io.h 为接口文件, 可在 [github](https://github.com/PaddlePaddle/paddle-mobile/blob/develop/src/io/io.h)上查看接口注释 + +#### 如使用 oc 接口 +将在xcode 编译生成的 +``` +libPaddleMobile.a +PaddleMobile.h +``` +拖入工程, 接口如下: + +``` +/* + 创建单例对象 +*/ ++ (instancetype)sharedInstance; + +/* + load 模型, 开辟内存 +*/ +- (BOOL)load:(NSString *)modelPath andWeightsPath:(NSString *)weighsPath; + +/* + 进行预测, means 和 scale 为训练模型时的预处理参数, 如训练时没有做这些预处理则直接使用 predict +*/ +- (NSArray *)predict:(CGImageRef)image means:(NSArray *)means scale:(float)scale; + +/* + 进行预测 +*/ +- (NSArray *)predict:(CGImageRef)image; + +/* + 清理内存 +*/ +- (void)clear; + +``` + + + + + + + + + + + + + diff --git a/doc/images/devices.png b/doc/images/devices.png new file mode 100644 index 0000000000000000000000000000000000000000..413d32c249972ee96f678d50a5cd0b36a2a03e29 Binary files /dev/null and b/doc/images/devices.png differ diff --git a/doc/images/flow_chart.png b/doc/images/flow_chart.png new file mode 100644 index 0000000000000000000000000000000000000000..c747230da43e2e688d7460704268631758d34596 Binary files /dev/null and b/doc/images/flow_chart.png differ diff --git a/doc/images/model_desc.png b/doc/images/model_desc.png new file mode 100644 index 0000000000000000000000000000000000000000..3c026b6192c8e1d84b3a82c3db91e022f35358c2 Binary files /dev/null and b/doc/images/model_desc.png differ diff --git a/doc/images/model_desc_combined.png b/doc/images/model_desc_combined.png new file mode 100644 index 0000000000000000000000000000000000000000..38e7388efcfdcad53f4e80ce0ac5d3b993eb986c Binary files /dev/null and b/doc/images/model_desc_combined.png differ diff --git a/ios/PaddleMobile.xcworkspace/contents.xcworkspacedata b/ios/PaddleMobile.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000000000000000000000000000000000..7c3243eefa5fdeaa40b8697bd8e0b5ba2daeeb55 --- /dev/null +++ b/ios/PaddleMobile.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/ios/PaddleMobile.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/PaddleMobile.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000000000000000000000000000000000..18d981003d68d0546c4804ac2ff47dd97c6e7921 --- /dev/null +++ b/ios/PaddleMobile.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/PaddleMobile.xcworkspace/xcuserdata/liuruilong.xcuserdatad/UserInterfaceState.xcuserstate b/ios/PaddleMobile.xcworkspace/xcuserdata/liuruilong.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..a74810d22b023830a6e44d19984ff92302eb84a3 Binary files /dev/null and b/ios/PaddleMobile.xcworkspace/xcuserdata/liuruilong.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ios/PaddleMobile.xcworkspace/xcuserdata/liuruilong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/ios/PaddleMobile.xcworkspace/xcuserdata/liuruilong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist new file mode 100644 index 0000000000000000000000000000000000000000..ed9a9b4d42c454d27017c91c04ce8b8a518ac029 --- /dev/null +++ b/ios/PaddleMobile.xcworkspace/xcuserdata/liuruilong.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -0,0 +1,5 @@ + + + diff --git a/ios/PaddleMobile/PaddleMobile.xcodeproj/project.pbxproj b/ios/PaddleMobile/PaddleMobile.xcodeproj/project.pbxproj new file mode 100644 index 0000000000000000000000000000000000000000..7907ac8955996b25f9173a6114bccad3b1e1bed9 --- /dev/null +++ b/ios/PaddleMobile/PaddleMobile.xcodeproj/project.pbxproj @@ -0,0 +1,965 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + FC086BB420E7839B00D85EF7 /* PaddleMobile.m in Sources */ = {isa = PBXBuildFile; fileRef = FC086BB320E7839B00D85EF7 /* PaddleMobile.m */; }; + FC086BB520E7839B00D85EF7 /* PaddleMobile.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = FC086BB220E7839B00D85EF7 /* PaddleMobile.h */; }; + FC086DC620E7841E00D85EF7 /* t_malloc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086CFE20E7841E00D85EF7 /* t_malloc.cpp */; }; + FC086DC720E7841E00D85EF7 /* lrn_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D0320E7841E00D85EF7 /* lrn_op.cpp */; }; + FC086DC820E7841E00D85EF7 /* sigmoid_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D0520E7841E00D85EF7 /* sigmoid_op.cpp */; }; + FC086DC920E7841E00D85EF7 /* box_coder_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D0620E7841E00D85EF7 /* box_coder_op.cpp */; }; + FC086DCA20E7841E00D85EF7 /* feed_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D0720E7841E00D85EF7 /* feed_op.cpp */; }; + FC086DCB20E7841E00D85EF7 /* fusion_conv_add_bn_relu_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D0A20E7841E00D85EF7 /* fusion_conv_add_bn_relu_op.cpp */; }; + FC086DCC20E7841E00D85EF7 /* reshape_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D0B20E7841E00D85EF7 /* reshape_op.cpp */; }; + FC086DCD20E7841E00D85EF7 /* concat_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D0C20E7841E00D85EF7 /* concat_op.cpp */; }; + FC086DCE20E7841E00D85EF7 /* transpose_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D0D20E7841E00D85EF7 /* transpose_op.cpp */; }; + FC086DCF20E7841E00D85EF7 /* prior_box_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D0E20E7841E00D85EF7 /* prior_box_op.cpp */; }; + FC086DD020E7841E00D85EF7 /* fusion_conv_add_relu_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D0F20E7841E00D85EF7 /* fusion_conv_add_relu_op.cpp */; }; + FC086DD120E7841E00D85EF7 /* softmax_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D1520E7841E00D85EF7 /* softmax_op.cpp */; }; + FC086DD220E7841E00D85EF7 /* depthwise_conv_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D1720E7841E00D85EF7 /* depthwise_conv_op.cpp */; }; + FC086DD320E7841E00D85EF7 /* elementwise_add_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D1A20E7841E00D85EF7 /* elementwise_add_op.cpp */; }; + FC086DD420E7841E00D85EF7 /* gemm.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D1F20E7841E00D85EF7 /* gemm.cpp */; }; + FC086DD520E7841E00D85EF7 /* pool_2x2.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D2220E7841E00D85EF7 /* pool_2x2.cpp */; }; + FC086DD620E7841E00D85EF7 /* im2col.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D2320E7841E00D85EF7 /* im2col.cpp */; }; + FC086DD720E7841E00D85EF7 /* vol2col.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D2620E7841E00D85EF7 /* vol2col.cpp */; }; + FC086DD820E7841E00D85EF7 /* math_function.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D2720E7841E00D85EF7 /* math_function.cpp */; }; + FC086DD920E7841E00D85EF7 /* pool_3x3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D2820E7841E00D85EF7 /* pool_3x3.cpp */; }; + FC086DDA20E7841E00D85EF7 /* pooling.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D2B20E7841E00D85EF7 /* pooling.cpp */; }; + FC086DDB20E7841E00D85EF7 /* depthwise_conv_3x3.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D2D20E7841E00D85EF7 /* depthwise_conv_3x3.cpp */; }; + FC086DDC20E7841E00D85EF7 /* softmax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D2F20E7841E00D85EF7 /* softmax.cpp */; }; + FC086DDD20E7841E00D85EF7 /* fetch_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D3420E7841E00D85EF7 /* fetch_op.cpp */; }; + FC086DDE20E7841E00D85EF7 /* fusion_conv_add.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D3520E7841E00D85EF7 /* fusion_conv_add.cpp */; }; + FC086DDF20E7841E00D85EF7 /* op_param.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D3620E7841E00D85EF7 /* op_param.cpp */; }; + FC086DE020E7841E00D85EF7 /* mul_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D3A20E7841E00D85EF7 /* mul_op.cpp */; }; + FC086DE120E7841E00D85EF7 /* relu_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D3B20E7841E00D85EF7 /* relu_op.cpp */; }; + FC086DE220E7841E00D85EF7 /* conv_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D3C20E7841E00D85EF7 /* conv_op.cpp */; }; + FC086DE320E7841E00D85EF7 /* fusion_fc_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D3D20E7841E00D85EF7 /* fusion_fc_op.cpp */; }; + FC086DE420E7841E00D85EF7 /* batchnorm_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D4020E7841E00D85EF7 /* batchnorm_op.cpp */; }; + FC086DE520E7841E00D85EF7 /* pool_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D4220E7841E00D85EF7 /* pool_op.cpp */; }; + FC086DE620E7841E00D85EF7 /* multiclass_nms_op.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D4420E7841E00D85EF7 /* multiclass_nms_op.cpp */; }; + FC086DE720E7841E00D85EF7 /* acl_tensor.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC086D5220E7841E00D85EF7 /* acl_tensor.cc */; }; + FC086DE820E7841E00D85EF7 /* acl_operator.cc in Sources */ = {isa = PBXBuildFile; fileRef = FC086D5320E7841E00D85EF7 /* acl_operator.cc */; }; + FC086DE920E7841E00D85EF7 /* conv_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D5420E7841E00D85EF7 /* conv_kernel.cpp */; }; + FC086DEA20E7841E00D85EF7 /* conv_add_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D5620E7841E00D85EF7 /* conv_add_kernel.cpp */; }; + FC086DEB20E7841E00D85EF7 /* relu_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D5820E7841E00D85EF7 /* relu_kernel.cpp */; }; + FC086DEC20E7841E00D85EF7 /* mul_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D5920E7841E00D85EF7 /* mul_kernel.cpp */; }; + FC086DED20E7841E00D85EF7 /* elementwise_add_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D5A20E7841E00D85EF7 /* elementwise_add_kernel.cpp */; }; + FC086DEE20E7841E00D85EF7 /* softmax_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D5C20E7841E00D85EF7 /* softmax_kernel.cpp */; }; + FC086DEF20E7841E00D85EF7 /* concat_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D5D20E7841E00D85EF7 /* concat_kernel.cpp */; }; + FC086DF020E7841E00D85EF7 /* pool_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D5E20E7841E00D85EF7 /* pool_kernel.cpp */; }; + FC086DF120E7841E00D85EF7 /* reshape_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D5F20E7841E00D85EF7 /* reshape_kernel.cpp */; }; + FC086DF220E7841E00D85EF7 /* lrn_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D6020E7841E00D85EF7 /* lrn_kernel.cpp */; }; + FC086DF320E7841E00D85EF7 /* fushion_fc_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D6120E7841E00D85EF7 /* fushion_fc_kernel.cpp */; }; + FC086DF420E7841E00D85EF7 /* batchnorm_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D6220E7841E00D85EF7 /* batchnorm_kernel.cpp */; }; + FC086DF520E7841E00D85EF7 /* conv_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D6F20E7841E00D85EF7 /* conv_kernel.cpp */; }; + FC086DF620E7841E00D85EF7 /* prior_box_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7420E7841E00D85EF7 /* prior_box_kernel.cpp */; }; + FC086DF720E7841E00D85EF7 /* conv_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7520E7841E00D85EF7 /* conv_kernel.cpp */; }; + FC086DF820E7841E00D85EF7 /* conv_add_bn_relu_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7620E7841E00D85EF7 /* conv_add_bn_relu_kernel.cpp */; }; + FC086DF920E7841E00D85EF7 /* box_coder_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7720E7841E00D85EF7 /* box_coder_kernel.cpp */; }; + FC086DFA20E7841E00D85EF7 /* conv_add_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7820E7841E00D85EF7 /* conv_add_kernel.cpp */; }; + FC086DFB20E7841E00D85EF7 /* sigmoid_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7920E7841E00D85EF7 /* sigmoid_kernel.cpp */; }; + FC086DFC20E7841E00D85EF7 /* relu_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7A20E7841E00D85EF7 /* relu_kernel.cpp */; }; + FC086DFD20E7841E00D85EF7 /* mul_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7B20E7841E00D85EF7 /* mul_kernel.cpp */; }; + FC086DFE20E7841E00D85EF7 /* elementwise_add_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7C20E7841E00D85EF7 /* elementwise_add_kernel.cpp */; }; + FC086DFF20E7841E00D85EF7 /* conv_add_relu_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7D20E7841E00D85EF7 /* conv_add_relu_kernel.cpp */; }; + FC086E0020E7841E00D85EF7 /* transpose_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7E20E7841E00D85EF7 /* transpose_kernel.cpp */; }; + FC086E0120E7841E00D85EF7 /* depthwise_conv_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D7F20E7841E00D85EF7 /* depthwise_conv_kernel.cpp */; }; + FC086E0220E7841E00D85EF7 /* softmax_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D8020E7841E00D85EF7 /* softmax_kernel.cpp */; }; + FC086E0320E7841E00D85EF7 /* concat_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D8120E7841E00D85EF7 /* concat_kernel.cpp */; }; + FC086E0420E7841E00D85EF7 /* fusion_fc_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D8220E7841E00D85EF7 /* fusion_fc_kernel.cpp */; }; + FC086E0520E7841E00D85EF7 /* pool_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D8320E7841E00D85EF7 /* pool_kernel.cpp */; }; + FC086E0620E7841E00D85EF7 /* reshape_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D8420E7841E00D85EF7 /* reshape_kernel.cpp */; }; + FC086E0720E7841E00D85EF7 /* lrn_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D8520E7841E00D85EF7 /* lrn_kernel.cpp */; }; + FC086E0820E7841E00D85EF7 /* batchnorm_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D8620E7841E00D85EF7 /* batchnorm_kernel.cpp */; }; + FC086E0920E7841E00D85EF7 /* multiclass_nms_kernel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D8720E7841E00D85EF7 /* multiclass_nms_kernel.cpp */; }; + FC086E0A20E7841E00D85EF7 /* framework.pb-c.c in Sources */ = {isa = PBXBuildFile; fileRef = FC086D8B20E7841E00D85EF7 /* framework.pb-c.c */; }; + FC086E0B20E7841E00D85EF7 /* tensor_util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D8C20E7841E00D85EF7 /* tensor_util.cpp */; }; + FC086E0C20E7841E00D85EF7 /* operator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D8F20E7841E00D85EF7 /* operator.cpp */; }; + FC086E0D20E7841E00D85EF7 /* ddim.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D9020E7841E00D85EF7 /* ddim.cpp */; }; + FC086E0E20E7841E00D85EF7 /* scope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D9320E7841E00D85EF7 /* scope.cpp */; }; + FC086E0F20E7841E00D85EF7 /* attribute.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D9920E7841E00D85EF7 /* attribute.cpp */; }; + FC086E1020E7841E00D85EF7 /* op_desc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D9C20E7841E00D85EF7 /* op_desc.cpp */; }; + FC086E1120E7841E00D85EF7 /* program_desc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086D9D20E7841E00D85EF7 /* program_desc.cpp */; }; + FC086E1220E7841E00D85EF7 /* node.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086DA320E7841E00D85EF7 /* node.cpp */; }; + FC086E1320E7841E00D85EF7 /* program_optimize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086DA620E7841E00D85EF7 /* program_optimize.cpp */; }; + FC086E1420E7841E00D85EF7 /* block_desc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086DA720E7841E00D85EF7 /* block_desc.cpp */; }; + FC086E1520E7841E00D85EF7 /* lod_tensor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086DAB20E7841E00D85EF7 /* lod_tensor.cpp */; }; + FC086E1620E7841E00D85EF7 /* io.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086DB320E7841E00D85EF7 /* io.cpp */; }; + FC086E1720E7841E00D85EF7 /* types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086DB620E7841E00D85EF7 /* types.cpp */; }; + FC086E1820E7841E00D85EF7 /* openmp-fix.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086DBA20E7841E00D85EF7 /* openmp-fix.cpp */; }; + FC086E1920E7841E00D85EF7 /* protobuf-c.c in Sources */ = {isa = PBXBuildFile; fileRef = FC086DC120E7841E00D85EF7 /* protobuf-c.c */; }; + FC086E1A20E7841E00D85EF7 /* paddle_mobile_jni.cpp in Sources */ = {isa = PBXBuildFile; fileRef = FC086DC420E7841E00D85EF7 /* paddle_mobile_jni.cpp */; }; +/* End PBXBuildFile section */ + +/* Begin PBXCopyFilesBuildPhase section */ + FC086BAD20E7839B00D85EF7 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = "include/$(PRODUCT_NAME)"; + dstSubfolderSpec = 16; + files = ( + FC086BB520E7839B00D85EF7 /* PaddleMobile.h in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + +/* Begin PBXFileReference section */ + FC086BAF20E7839B00D85EF7 /* libPaddleMobile.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPaddleMobile.a; sourceTree = BUILT_PRODUCTS_DIR; }; + FC086BB220E7839B00D85EF7 /* PaddleMobile.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PaddleMobile.h; sourceTree = ""; }; + FC086BB320E7839B00D85EF7 /* PaddleMobile.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PaddleMobile.m; sourceTree = ""; }; + FC086CFE20E7841E00D85EF7 /* t_malloc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = t_malloc.cpp; sourceTree = ""; }; + FC086CFF20E7841E00D85EF7 /* t_malloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = t_malloc.h; sourceTree = ""; }; + FC086D0120E7841E00D85EF7 /* feed_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = feed_op.h; sourceTree = ""; }; + FC086D0220E7841E00D85EF7 /* fusion_conv_add_bn_relu_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fusion_conv_add_bn_relu_op.h; sourceTree = ""; }; + FC086D0320E7841E00D85EF7 /* lrn_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lrn_op.cpp; sourceTree = ""; }; + FC086D0420E7841E00D85EF7 /* op_param.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = op_param.h; sourceTree = ""; }; + FC086D0520E7841E00D85EF7 /* sigmoid_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sigmoid_op.cpp; sourceTree = ""; }; + FC086D0620E7841E00D85EF7 /* box_coder_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = box_coder_op.cpp; sourceTree = ""; }; + FC086D0720E7841E00D85EF7 /* feed_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = feed_op.cpp; sourceTree = ""; }; + FC086D0820E7841E00D85EF7 /* mul_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mul_op.h; sourceTree = ""; }; + FC086D0920E7841E00D85EF7 /* prior_box_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prior_box_op.h; sourceTree = ""; }; + FC086D0A20E7841E00D85EF7 /* fusion_conv_add_bn_relu_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fusion_conv_add_bn_relu_op.cpp; sourceTree = ""; }; + FC086D0B20E7841E00D85EF7 /* reshape_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = reshape_op.cpp; sourceTree = ""; }; + FC086D0C20E7841E00D85EF7 /* concat_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = concat_op.cpp; sourceTree = ""; }; + FC086D0D20E7841E00D85EF7 /* transpose_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = transpose_op.cpp; sourceTree = ""; }; + FC086D0E20E7841E00D85EF7 /* prior_box_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prior_box_op.cpp; sourceTree = ""; }; + FC086D0F20E7841E00D85EF7 /* fusion_conv_add_relu_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fusion_conv_add_relu_op.cpp; sourceTree = ""; }; + FC086D1020E7841E00D85EF7 /* lrn_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lrn_op.h; sourceTree = ""; }; + FC086D1120E7841E00D85EF7 /* multiclass_nms_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = multiclass_nms_op.h; sourceTree = ""; }; + FC086D1220E7841E00D85EF7 /* relu_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = relu_op.h; sourceTree = ""; }; + FC086D1320E7841E00D85EF7 /* fusion_conv_add.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fusion_conv_add.h; sourceTree = ""; }; + FC086D1420E7841E00D85EF7 /* conv_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conv_op.h; sourceTree = ""; }; + FC086D1520E7841E00D85EF7 /* softmax_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = softmax_op.cpp; sourceTree = ""; }; + FC086D1620E7841E00D85EF7 /* pool_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pool_op.h; sourceTree = ""; }; + FC086D1720E7841E00D85EF7 /* depthwise_conv_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = depthwise_conv_op.cpp; sourceTree = ""; }; + FC086D1820E7841E00D85EF7 /* softmax_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = softmax_op.h; sourceTree = ""; }; + FC086D1920E7841E00D85EF7 /* elementwise_add_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = elementwise_add_op.h; sourceTree = ""; }; + FC086D1A20E7841E00D85EF7 /* elementwise_add_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = elementwise_add_op.cpp; sourceTree = ""; }; + FC086D1B20E7841E00D85EF7 /* fetch_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fetch_op.h; sourceTree = ""; }; + FC086D1D20E7841E00D85EF7 /* elementwise_op_function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = elementwise_op_function.h; sourceTree = ""; }; + FC086D1E20E7841E00D85EF7 /* softmax.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = softmax.h; sourceTree = ""; }; + FC086D1F20E7841E00D85EF7 /* gemm.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = gemm.cpp; sourceTree = ""; }; + FC086D2020E7841E00D85EF7 /* math_function.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = math_function.h; sourceTree = ""; }; + FC086D2120E7841E00D85EF7 /* conv_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conv_func.h; sourceTree = ""; }; + FC086D2220E7841E00D85EF7 /* pool_2x2.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pool_2x2.cpp; sourceTree = ""; }; + FC086D2320E7841E00D85EF7 /* im2col.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = im2col.cpp; sourceTree = ""; }; + FC086D2420E7841E00D85EF7 /* gemm.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = gemm.h; sourceTree = ""; }; + FC086D2520E7841E00D85EF7 /* im2col.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = im2col.h; sourceTree = ""; }; + FC086D2620E7841E00D85EF7 /* vol2col.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = vol2col.cpp; sourceTree = ""; }; + FC086D2720E7841E00D85EF7 /* math_function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = math_function.cpp; sourceTree = ""; }; + FC086D2820E7841E00D85EF7 /* pool_3x3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pool_3x3.cpp; sourceTree = ""; }; + FC086D2920E7841E00D85EF7 /* pool_2x2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pool_2x2.h; sourceTree = ""; }; + FC086D2A20E7841E00D85EF7 /* depthwise_conv_3x3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = depthwise_conv_3x3.h; sourceTree = ""; }; + FC086D2B20E7841E00D85EF7 /* pooling.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pooling.cpp; sourceTree = ""; }; + FC086D2C20E7841E00D85EF7 /* pool_3x3.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pool_3x3.h; sourceTree = ""; }; + FC086D2D20E7841E00D85EF7 /* depthwise_conv_3x3.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = depthwise_conv_3x3.cpp; sourceTree = ""; }; + FC086D2E20E7841E00D85EF7 /* vol2col.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = vol2col.h; sourceTree = ""; }; + FC086D2F20E7841E00D85EF7 /* softmax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = softmax.cpp; sourceTree = ""; }; + FC086D3020E7841E00D85EF7 /* transform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = transform.h; sourceTree = ""; }; + FC086D3120E7841E00D85EF7 /* pooling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pooling.h; sourceTree = ""; }; + FC086D3220E7841E00D85EF7 /* math_func_neon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = math_func_neon.h; sourceTree = ""; }; + FC086D3320E7841E00D85EF7 /* fusion_conv_add_relu_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fusion_conv_add_relu_op.h; sourceTree = ""; }; + FC086D3420E7841E00D85EF7 /* fetch_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fetch_op.cpp; sourceTree = ""; }; + FC086D3520E7841E00D85EF7 /* fusion_conv_add.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fusion_conv_add.cpp; sourceTree = ""; }; + FC086D3620E7841E00D85EF7 /* op_param.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = op_param.cpp; sourceTree = ""; }; + FC086D3720E7841E00D85EF7 /* transpose_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = transpose_op.h; sourceTree = ""; }; + FC086D3820E7841E00D85EF7 /* fusion_fc_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fusion_fc_op.h; sourceTree = ""; }; + FC086D3920E7841E00D85EF7 /* batchnorm_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = batchnorm_op.h; sourceTree = ""; }; + FC086D3A20E7841E00D85EF7 /* mul_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mul_op.cpp; sourceTree = ""; }; + FC086D3B20E7841E00D85EF7 /* relu_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = relu_op.cpp; sourceTree = ""; }; + FC086D3C20E7841E00D85EF7 /* conv_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = conv_op.cpp; sourceTree = ""; }; + FC086D3D20E7841E00D85EF7 /* fusion_fc_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fusion_fc_op.cpp; sourceTree = ""; }; + FC086D3E20E7841E00D85EF7 /* box_coder_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = box_coder_op.h; sourceTree = ""; }; + FC086D3F20E7841E00D85EF7 /* concat_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = concat_op.h; sourceTree = ""; }; + FC086D4020E7841E00D85EF7 /* batchnorm_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = batchnorm_op.cpp; sourceTree = ""; }; + FC086D4120E7841E00D85EF7 /* reshape_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reshape_op.h; sourceTree = ""; }; + FC086D4220E7841E00D85EF7 /* pool_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pool_op.cpp; sourceTree = ""; }; + FC086D4320E7841E00D85EF7 /* sigmoid_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sigmoid_op.h; sourceTree = ""; }; + FC086D4420E7841E00D85EF7 /* multiclass_nms_op.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = multiclass_nms_op.cpp; sourceTree = ""; }; + FC086D4620E7841E00D85EF7 /* relu_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = relu_kernel.h; sourceTree = ""; }; + FC086D4720E7841E00D85EF7 /* multiclass_nms_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = multiclass_nms_kernel.h; sourceTree = ""; }; + FC086D4820E7841E00D85EF7 /* depthwise_conv_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = depthwise_conv_kernel.h; sourceTree = ""; }; + FC086D4920E7841E00D85EF7 /* lrn_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lrn_kernel.h; sourceTree = ""; }; + FC086D4A20E7841E00D85EF7 /* pool_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pool_kernel.h; sourceTree = ""; }; + FC086D4B20E7841E00D85EF7 /* fusion_fc_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fusion_fc_kernel.h; sourceTree = ""; }; + FC086D4C20E7841E00D85EF7 /* box_coder_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = box_coder_kernel.h; sourceTree = ""; }; + FC086D4D20E7841E00D85EF7 /* concat_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = concat_kernel.h; sourceTree = ""; }; + FC086D4E20E7841E00D85EF7 /* mul_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = mul_kernel.h; sourceTree = ""; }; + FC086D4F20E7841E00D85EF7 /* softmax_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = softmax_kernel.h; sourceTree = ""; }; + FC086D5020E7841E00D85EF7 /* batchnorm_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = batchnorm_kernel.h; sourceTree = ""; }; + FC086D5220E7841E00D85EF7 /* acl_tensor.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = acl_tensor.cc; sourceTree = ""; }; + FC086D5320E7841E00D85EF7 /* acl_operator.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = acl_operator.cc; sourceTree = ""; }; + FC086D5420E7841E00D85EF7 /* conv_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = conv_kernel.cpp; sourceTree = ""; }; + FC086D5520E7841E00D85EF7 /* acl_operator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acl_operator.h; sourceTree = ""; }; + FC086D5620E7841E00D85EF7 /* conv_add_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = conv_add_kernel.cpp; sourceTree = ""; }; + FC086D5720E7841E00D85EF7 /* acl_tensor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = acl_tensor.h; sourceTree = ""; }; + FC086D5820E7841E00D85EF7 /* relu_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = relu_kernel.cpp; sourceTree = ""; }; + FC086D5920E7841E00D85EF7 /* mul_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mul_kernel.cpp; sourceTree = ""; }; + FC086D5A20E7841E00D85EF7 /* elementwise_add_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = elementwise_add_kernel.cpp; sourceTree = ""; }; + FC086D5C20E7841E00D85EF7 /* softmax_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = softmax_kernel.cpp; sourceTree = ""; }; + FC086D5D20E7841E00D85EF7 /* concat_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = concat_kernel.cpp; sourceTree = ""; }; + FC086D5E20E7841E00D85EF7 /* pool_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pool_kernel.cpp; sourceTree = ""; }; + FC086D5F20E7841E00D85EF7 /* reshape_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = reshape_kernel.cpp; sourceTree = ""; }; + FC086D6020E7841E00D85EF7 /* lrn_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lrn_kernel.cpp; sourceTree = ""; }; + FC086D6120E7841E00D85EF7 /* fushion_fc_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fushion_fc_kernel.cpp; sourceTree = ""; }; + FC086D6220E7841E00D85EF7 /* batchnorm_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = batchnorm_kernel.cpp; sourceTree = ""; }; + FC086D6320E7841E00D85EF7 /* elementwise_add_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = elementwise_add_kernel.h; sourceTree = ""; }; + FC086D6520E7841E00D85EF7 /* conv_arm_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conv_arm_func.h; sourceTree = ""; }; + FC086D6620E7841E00D85EF7 /* conv_add_bn_relu_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conv_add_bn_relu_func.h; sourceTree = ""; }; + FC086D6720E7841E00D85EF7 /* conv_add_relu_arm_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conv_add_relu_arm_func.h; sourceTree = ""; }; + FC086D6820E7841E00D85EF7 /* depthwise_conv_arm_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = depthwise_conv_arm_func.h; sourceTree = ""; }; + FC086D6920E7841E00D85EF7 /* batchnorm_arm_func.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = batchnorm_arm_func.h; sourceTree = ""; }; + FC086D6A20E7841E00D85EF7 /* conv_add_relu_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conv_add_relu_kernel.h; sourceTree = ""; }; + FC086D6B20E7841E00D85EF7 /* reshape_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = reshape_kernel.h; sourceTree = ""; }; + FC086D6C20E7841E00D85EF7 /* transpose_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = transpose_kernel.h; sourceTree = ""; }; + FC086D6D20E7841E00D85EF7 /* conv_add_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conv_add_kernel.h; sourceTree = ""; }; + FC086D6F20E7841E00D85EF7 /* conv_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = conv_kernel.cpp; sourceTree = ""; }; + FC086D7020E7841E00D85EF7 /* conv_add_bn_relu_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conv_add_bn_relu_kernel.h; sourceTree = ""; }; + FC086D7120E7841E00D85EF7 /* prior_box_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prior_box_kernel.h; sourceTree = ""; }; + FC086D7220E7841E00D85EF7 /* conv_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = conv_kernel.h; sourceTree = ""; }; + FC086D7420E7841E00D85EF7 /* prior_box_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prior_box_kernel.cpp; sourceTree = ""; }; + FC086D7520E7841E00D85EF7 /* conv_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = conv_kernel.cpp; sourceTree = ""; }; + FC086D7620E7841E00D85EF7 /* conv_add_bn_relu_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = conv_add_bn_relu_kernel.cpp; sourceTree = ""; }; + FC086D7720E7841E00D85EF7 /* box_coder_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = box_coder_kernel.cpp; sourceTree = ""; }; + FC086D7820E7841E00D85EF7 /* conv_add_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = conv_add_kernel.cpp; sourceTree = ""; }; + FC086D7920E7841E00D85EF7 /* sigmoid_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = sigmoid_kernel.cpp; sourceTree = ""; }; + FC086D7A20E7841E00D85EF7 /* relu_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = relu_kernel.cpp; sourceTree = ""; }; + FC086D7B20E7841E00D85EF7 /* mul_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = mul_kernel.cpp; sourceTree = ""; }; + FC086D7C20E7841E00D85EF7 /* elementwise_add_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = elementwise_add_kernel.cpp; sourceTree = ""; }; + FC086D7D20E7841E00D85EF7 /* conv_add_relu_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = conv_add_relu_kernel.cpp; sourceTree = ""; }; + FC086D7E20E7841E00D85EF7 /* transpose_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = transpose_kernel.cpp; sourceTree = ""; }; + FC086D7F20E7841E00D85EF7 /* depthwise_conv_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = depthwise_conv_kernel.cpp; sourceTree = ""; }; + FC086D8020E7841E00D85EF7 /* softmax_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = softmax_kernel.cpp; sourceTree = ""; }; + FC086D8120E7841E00D85EF7 /* concat_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = concat_kernel.cpp; sourceTree = ""; }; + FC086D8220E7841E00D85EF7 /* fusion_fc_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = fusion_fc_kernel.cpp; sourceTree = ""; }; + FC086D8320E7841E00D85EF7 /* pool_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pool_kernel.cpp; sourceTree = ""; }; + FC086D8420E7841E00D85EF7 /* reshape_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = reshape_kernel.cpp; sourceTree = ""; }; + FC086D8520E7841E00D85EF7 /* lrn_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lrn_kernel.cpp; sourceTree = ""; }; + FC086D8620E7841E00D85EF7 /* batchnorm_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = batchnorm_kernel.cpp; sourceTree = ""; }; + FC086D8720E7841E00D85EF7 /* multiclass_nms_kernel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = multiclass_nms_kernel.cpp; sourceTree = ""; }; + FC086D8820E7841E00D85EF7 /* sigmoid_kernel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = sigmoid_kernel.h; sourceTree = ""; }; + FC086D8920E7841E00D85EF7 /* depthwise_conv_op.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = depthwise_conv_op.h; sourceTree = ""; }; + FC086D8B20E7841E00D85EF7 /* framework.pb-c.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "framework.pb-c.c"; sourceTree = ""; }; + FC086D8C20E7841E00D85EF7 /* tensor_util.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = tensor_util.cpp; sourceTree = ""; }; + FC086D8D20E7841E00D85EF7 /* operator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = operator.h; sourceTree = ""; }; + FC086D8E20E7841E00D85EF7 /* op_info.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = op_info.h; sourceTree = ""; }; + FC086D8F20E7841E00D85EF7 /* operator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = operator.cpp; sourceTree = ""; }; + FC086D9020E7841E00D85EF7 /* ddim.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ddim.cpp; sourceTree = ""; }; + FC086D9120E7841E00D85EF7 /* tensor_util.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tensor_util.h; sourceTree = ""; }; + FC086D9220E7841E00D85EF7 /* variable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = variable.h; sourceTree = ""; }; + FC086D9320E7841E00D85EF7 /* scope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = scope.cpp; sourceTree = ""; }; + FC086D9420E7841E00D85EF7 /* data_layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = data_layout.h; sourceTree = ""; }; + FC086D9520E7841E00D85EF7 /* lod_tensor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = lod_tensor.h; sourceTree = ""; }; + FC086D9620E7841E00D85EF7 /* dim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dim.h; sourceTree = ""; }; + FC086D9720E7841E00D85EF7 /* framework.pb-c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "framework.pb-c.h"; sourceTree = ""; }; + FC086D9820E7841E00D85EF7 /* op_kernel_type.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = op_kernel_type.h; sourceTree = ""; }; + FC086D9920E7841E00D85EF7 /* attribute.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = attribute.cpp; sourceTree = ""; }; + FC086D9A20E7841E00D85EF7 /* op_proto_maker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = op_proto_maker.h; sourceTree = ""; }; + FC086D9C20E7841E00D85EF7 /* op_desc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = op_desc.cpp; sourceTree = ""; }; + FC086D9D20E7841E00D85EF7 /* program_desc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = program_desc.cpp; sourceTree = ""; }; + FC086D9E20E7841E00D85EF7 /* var_desc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = var_desc.h; sourceTree = ""; }; + FC086D9F20E7841E00D85EF7 /* program_desc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = program_desc.h; sourceTree = ""; }; + FC086DA020E7841E00D85EF7 /* op_desc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = op_desc.h; sourceTree = ""; }; + FC086DA220E7841E00D85EF7 /* fusion_op_register.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = fusion_op_register.h; sourceTree = ""; }; + FC086DA320E7841E00D85EF7 /* node.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = node.cpp; sourceTree = ""; }; + FC086DA420E7841E00D85EF7 /* node.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = node.h; sourceTree = ""; }; + FC086DA520E7841E00D85EF7 /* program_optimize.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = program_optimize.h; sourceTree = ""; }; + FC086DA620E7841E00D85EF7 /* program_optimize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = program_optimize.cpp; sourceTree = ""; }; + FC086DA720E7841E00D85EF7 /* block_desc.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = block_desc.cpp; sourceTree = ""; }; + FC086DA820E7841E00D85EF7 /* program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = program.h; sourceTree = ""; }; + FC086DA920E7841E00D85EF7 /* tensor_desc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tensor_desc.h; sourceTree = ""; }; + FC086DAA20E7841E00D85EF7 /* block_desc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = block_desc.h; sourceTree = ""; }; + FC086DAB20E7841E00D85EF7 /* lod_tensor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = lod_tensor.cpp; sourceTree = ""; }; + FC086DAC20E7841E00D85EF7 /* framework.proto */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = framework.proto; sourceTree = ""; }; + FC086DAD20E7841E00D85EF7 /* ddim.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ddim.h; sourceTree = ""; }; + FC086DAE20E7841E00D85EF7 /* attribute.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = attribute.h; sourceTree = ""; }; + FC086DAF20E7841E00D85EF7 /* scope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = scope.h; sourceTree = ""; }; + FC086DB020E7841E00D85EF7 /* tensor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = tensor.h; sourceTree = ""; }; + FC086DB120E7841E00D85EF7 /* op_registry.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = op_registry.h; sourceTree = ""; }; + FC086DB320E7841E00D85EF7 /* io.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = io.cpp; sourceTree = ""; }; + FC086DB420E7841E00D85EF7 /* io.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = io.h; sourceTree = ""; }; + FC086DB620E7841E00D85EF7 /* types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = types.cpp; sourceTree = ""; }; + FC086DB720E7841E00D85EF7 /* threadpool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = threadpool.h; sourceTree = ""; }; + FC086DB820E7841E00D85EF7 /* types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = types.h; sourceTree = ""; }; + FC086DB920E7841E00D85EF7 /* protobuf-c.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "protobuf-c.h"; sourceTree = ""; }; + FC086DBA20E7841E00D85EF7 /* openmp-fix.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = "openmp-fix.cpp"; sourceTree = ""; }; + FC086DBB20E7841E00D85EF7 /* dep_core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = dep_core.h; sourceTree = ""; }; + FC086DBC20E7841E00D85EF7 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = ""; }; + FC086DBD20E7841E00D85EF7 /* log.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = log.h; sourceTree = ""; }; + FC086DBE20E7841E00D85EF7 /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = macros.h; sourceTree = ""; }; + FC086DBF20E7841E00D85EF7 /* type_define.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = type_define.h; sourceTree = ""; }; + FC086DC020E7841E00D85EF7 /* enforce.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = enforce.h; sourceTree = ""; }; + FC086DC120E7841E00D85EF7 /* protobuf-c.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "protobuf-c.c"; sourceTree = ""; }; + FC086DC220E7841E00D85EF7 /* variant.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = variant.h; sourceTree = ""; }; + FC086DC420E7841E00D85EF7 /* paddle_mobile_jni.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = paddle_mobile_jni.cpp; sourceTree = ""; }; + FC086DC520E7841E00D85EF7 /* paddle_mobile_jni.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = paddle_mobile_jni.h; sourceTree = ""; }; + FC2428A520E78DF20095932F /* MacroDefine.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MacroDefine.h; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FC086BAC20E7839B00D85EF7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FC086BA620E7839B00D85EF7 = { + isa = PBXGroup; + children = ( + FC086BB120E7839B00D85EF7 /* PaddleMobile */, + FC086BB020E7839B00D85EF7 /* Products */, + ); + sourceTree = ""; + }; + FC086BB020E7839B00D85EF7 /* Products */ = { + isa = PBXGroup; + children = ( + FC086BAF20E7839B00D85EF7 /* libPaddleMobile.a */, + ); + name = Products; + sourceTree = ""; + }; + FC086BB120E7839B00D85EF7 /* PaddleMobile */ = { + isa = PBXGroup; + children = ( + FC086CFC20E7841E00D85EF7 /* src */, + FC086BB220E7839B00D85EF7 /* PaddleMobile.h */, + FC086BB320E7839B00D85EF7 /* PaddleMobile.m */, + FC2428A520E78DF20095932F /* MacroDefine.h */, + ); + path = PaddleMobile; + sourceTree = ""; + }; + FC086CFC20E7841E00D85EF7 /* src */ = { + isa = PBXGroup; + children = ( + FC086CFD20E7841E00D85EF7 /* memory */, + FC086D0020E7841E00D85EF7 /* operators */, + FC086D8A20E7841E00D85EF7 /* framework */, + FC086DB220E7841E00D85EF7 /* io */, + FC086DB520E7841E00D85EF7 /* common */, + FC086DC320E7841E00D85EF7 /* jni */, + ); + name = src; + path = ../../../src; + sourceTree = ""; + }; + FC086CFD20E7841E00D85EF7 /* memory */ = { + isa = PBXGroup; + children = ( + FC086CFE20E7841E00D85EF7 /* t_malloc.cpp */, + FC086CFF20E7841E00D85EF7 /* t_malloc.h */, + ); + path = memory; + sourceTree = ""; + }; + FC086D0020E7841E00D85EF7 /* operators */ = { + isa = PBXGroup; + children = ( + FC086D0120E7841E00D85EF7 /* feed_op.h */, + FC086D0220E7841E00D85EF7 /* fusion_conv_add_bn_relu_op.h */, + FC086D0320E7841E00D85EF7 /* lrn_op.cpp */, + FC086D0420E7841E00D85EF7 /* op_param.h */, + FC086D0520E7841E00D85EF7 /* sigmoid_op.cpp */, + FC086D0620E7841E00D85EF7 /* box_coder_op.cpp */, + FC086D0720E7841E00D85EF7 /* feed_op.cpp */, + FC086D0820E7841E00D85EF7 /* mul_op.h */, + FC086D0920E7841E00D85EF7 /* prior_box_op.h */, + FC086D0A20E7841E00D85EF7 /* fusion_conv_add_bn_relu_op.cpp */, + FC086D0B20E7841E00D85EF7 /* reshape_op.cpp */, + FC086D0C20E7841E00D85EF7 /* concat_op.cpp */, + FC086D0D20E7841E00D85EF7 /* transpose_op.cpp */, + FC086D0E20E7841E00D85EF7 /* prior_box_op.cpp */, + FC086D0F20E7841E00D85EF7 /* fusion_conv_add_relu_op.cpp */, + FC086D1020E7841E00D85EF7 /* lrn_op.h */, + FC086D1120E7841E00D85EF7 /* multiclass_nms_op.h */, + FC086D1220E7841E00D85EF7 /* relu_op.h */, + FC086D1320E7841E00D85EF7 /* fusion_conv_add.h */, + FC086D1420E7841E00D85EF7 /* conv_op.h */, + FC086D1520E7841E00D85EF7 /* softmax_op.cpp */, + FC086D1620E7841E00D85EF7 /* pool_op.h */, + FC086D1720E7841E00D85EF7 /* depthwise_conv_op.cpp */, + FC086D1820E7841E00D85EF7 /* softmax_op.h */, + FC086D1920E7841E00D85EF7 /* elementwise_add_op.h */, + FC086D1A20E7841E00D85EF7 /* elementwise_add_op.cpp */, + FC086D1B20E7841E00D85EF7 /* fetch_op.h */, + FC086D1C20E7841E00D85EF7 /* math */, + FC086D3320E7841E00D85EF7 /* fusion_conv_add_relu_op.h */, + FC086D3420E7841E00D85EF7 /* fetch_op.cpp */, + FC086D3520E7841E00D85EF7 /* fusion_conv_add.cpp */, + FC086D3620E7841E00D85EF7 /* op_param.cpp */, + FC086D3720E7841E00D85EF7 /* transpose_op.h */, + FC086D3820E7841E00D85EF7 /* fusion_fc_op.h */, + FC086D3920E7841E00D85EF7 /* batchnorm_op.h */, + FC086D3A20E7841E00D85EF7 /* mul_op.cpp */, + FC086D3B20E7841E00D85EF7 /* relu_op.cpp */, + FC086D3C20E7841E00D85EF7 /* conv_op.cpp */, + FC086D3D20E7841E00D85EF7 /* fusion_fc_op.cpp */, + FC086D3E20E7841E00D85EF7 /* box_coder_op.h */, + FC086D3F20E7841E00D85EF7 /* concat_op.h */, + FC086D4020E7841E00D85EF7 /* batchnorm_op.cpp */, + FC086D4120E7841E00D85EF7 /* reshape_op.h */, + FC086D4220E7841E00D85EF7 /* pool_op.cpp */, + FC086D4320E7841E00D85EF7 /* sigmoid_op.h */, + FC086D4420E7841E00D85EF7 /* multiclass_nms_op.cpp */, + FC086D4520E7841E00D85EF7 /* kernel */, + FC086D8920E7841E00D85EF7 /* depthwise_conv_op.h */, + ); + path = operators; + sourceTree = ""; + }; + FC086D1C20E7841E00D85EF7 /* math */ = { + isa = PBXGroup; + children = ( + FC086D1D20E7841E00D85EF7 /* elementwise_op_function.h */, + FC086D1E20E7841E00D85EF7 /* softmax.h */, + FC086D1F20E7841E00D85EF7 /* gemm.cpp */, + FC086D2020E7841E00D85EF7 /* math_function.h */, + FC086D2120E7841E00D85EF7 /* conv_func.h */, + FC086D2220E7841E00D85EF7 /* pool_2x2.cpp */, + FC086D2320E7841E00D85EF7 /* im2col.cpp */, + FC086D2420E7841E00D85EF7 /* gemm.h */, + FC086D2520E7841E00D85EF7 /* im2col.h */, + FC086D2620E7841E00D85EF7 /* vol2col.cpp */, + FC086D2720E7841E00D85EF7 /* math_function.cpp */, + FC086D2820E7841E00D85EF7 /* pool_3x3.cpp */, + FC086D2920E7841E00D85EF7 /* pool_2x2.h */, + FC086D2A20E7841E00D85EF7 /* depthwise_conv_3x3.h */, + FC086D2B20E7841E00D85EF7 /* pooling.cpp */, + FC086D2C20E7841E00D85EF7 /* pool_3x3.h */, + FC086D2D20E7841E00D85EF7 /* depthwise_conv_3x3.cpp */, + FC086D2E20E7841E00D85EF7 /* vol2col.h */, + FC086D2F20E7841E00D85EF7 /* softmax.cpp */, + FC086D3020E7841E00D85EF7 /* transform.h */, + FC086D3120E7841E00D85EF7 /* pooling.h */, + FC086D3220E7841E00D85EF7 /* math_func_neon.h */, + ); + path = math; + sourceTree = ""; + }; + FC086D4520E7841E00D85EF7 /* kernel */ = { + isa = PBXGroup; + children = ( + FC086D4620E7841E00D85EF7 /* relu_kernel.h */, + FC086D4720E7841E00D85EF7 /* multiclass_nms_kernel.h */, + FC086D4820E7841E00D85EF7 /* depthwise_conv_kernel.h */, + FC086D4920E7841E00D85EF7 /* lrn_kernel.h */, + FC086D4A20E7841E00D85EF7 /* pool_kernel.h */, + FC086D4B20E7841E00D85EF7 /* fusion_fc_kernel.h */, + FC086D4C20E7841E00D85EF7 /* box_coder_kernel.h */, + FC086D4D20E7841E00D85EF7 /* concat_kernel.h */, + FC086D4E20E7841E00D85EF7 /* mul_kernel.h */, + FC086D4F20E7841E00D85EF7 /* softmax_kernel.h */, + FC086D5020E7841E00D85EF7 /* batchnorm_kernel.h */, + FC086D5120E7841E00D85EF7 /* mali */, + FC086D6320E7841E00D85EF7 /* elementwise_add_kernel.h */, + FC086D6420E7841E00D85EF7 /* central-arm-func */, + FC086D6A20E7841E00D85EF7 /* conv_add_relu_kernel.h */, + FC086D6B20E7841E00D85EF7 /* reshape_kernel.h */, + FC086D6C20E7841E00D85EF7 /* transpose_kernel.h */, + FC086D6D20E7841E00D85EF7 /* conv_add_kernel.h */, + FC086D6E20E7841E00D85EF7 /* fpga */, + FC086D7020E7841E00D85EF7 /* conv_add_bn_relu_kernel.h */, + FC086D7120E7841E00D85EF7 /* prior_box_kernel.h */, + FC086D7220E7841E00D85EF7 /* conv_kernel.h */, + FC086D7320E7841E00D85EF7 /* arm */, + FC086D8820E7841E00D85EF7 /* sigmoid_kernel.h */, + ); + path = kernel; + sourceTree = ""; + }; + FC086D5120E7841E00D85EF7 /* mali */ = { + isa = PBXGroup; + children = ( + FC086D5220E7841E00D85EF7 /* acl_tensor.cc */, + FC086D5320E7841E00D85EF7 /* acl_operator.cc */, + FC086D5420E7841E00D85EF7 /* conv_kernel.cpp */, + FC086D5520E7841E00D85EF7 /* acl_operator.h */, + FC086D5620E7841E00D85EF7 /* conv_add_kernel.cpp */, + FC086D5720E7841E00D85EF7 /* acl_tensor.h */, + FC086D5820E7841E00D85EF7 /* relu_kernel.cpp */, + FC086D5920E7841E00D85EF7 /* mul_kernel.cpp */, + FC086D5A20E7841E00D85EF7 /* elementwise_add_kernel.cpp */, + FC086D5B20E7841E00D85EF7 /* ACL_Android */, + FC086D5C20E7841E00D85EF7 /* softmax_kernel.cpp */, + FC086D5D20E7841E00D85EF7 /* concat_kernel.cpp */, + FC086D5E20E7841E00D85EF7 /* pool_kernel.cpp */, + FC086D5F20E7841E00D85EF7 /* reshape_kernel.cpp */, + FC086D6020E7841E00D85EF7 /* lrn_kernel.cpp */, + FC086D6120E7841E00D85EF7 /* fushion_fc_kernel.cpp */, + FC086D6220E7841E00D85EF7 /* batchnorm_kernel.cpp */, + ); + path = mali; + sourceTree = ""; + }; + FC086D5B20E7841E00D85EF7 /* ACL_Android */ = { + isa = PBXGroup; + children = ( + ); + path = ACL_Android; + sourceTree = ""; + }; + FC086D6420E7841E00D85EF7 /* central-arm-func */ = { + isa = PBXGroup; + children = ( + FC086D6520E7841E00D85EF7 /* conv_arm_func.h */, + FC086D6620E7841E00D85EF7 /* conv_add_bn_relu_func.h */, + FC086D6720E7841E00D85EF7 /* conv_add_relu_arm_func.h */, + FC086D6820E7841E00D85EF7 /* depthwise_conv_arm_func.h */, + FC086D6920E7841E00D85EF7 /* batchnorm_arm_func.h */, + ); + path = "central-arm-func"; + sourceTree = ""; + }; + FC086D6E20E7841E00D85EF7 /* fpga */ = { + isa = PBXGroup; + children = ( + FC086D6F20E7841E00D85EF7 /* conv_kernel.cpp */, + ); + path = fpga; + sourceTree = ""; + }; + FC086D7320E7841E00D85EF7 /* arm */ = { + isa = PBXGroup; + children = ( + FC086D7420E7841E00D85EF7 /* prior_box_kernel.cpp */, + FC086D7520E7841E00D85EF7 /* conv_kernel.cpp */, + FC086D7620E7841E00D85EF7 /* conv_add_bn_relu_kernel.cpp */, + FC086D7720E7841E00D85EF7 /* box_coder_kernel.cpp */, + FC086D7820E7841E00D85EF7 /* conv_add_kernel.cpp */, + FC086D7920E7841E00D85EF7 /* sigmoid_kernel.cpp */, + FC086D7A20E7841E00D85EF7 /* relu_kernel.cpp */, + FC086D7B20E7841E00D85EF7 /* mul_kernel.cpp */, + FC086D7C20E7841E00D85EF7 /* elementwise_add_kernel.cpp */, + FC086D7D20E7841E00D85EF7 /* conv_add_relu_kernel.cpp */, + FC086D7E20E7841E00D85EF7 /* transpose_kernel.cpp */, + FC086D7F20E7841E00D85EF7 /* depthwise_conv_kernel.cpp */, + FC086D8020E7841E00D85EF7 /* softmax_kernel.cpp */, + FC086D8120E7841E00D85EF7 /* concat_kernel.cpp */, + FC086D8220E7841E00D85EF7 /* fusion_fc_kernel.cpp */, + FC086D8320E7841E00D85EF7 /* pool_kernel.cpp */, + FC086D8420E7841E00D85EF7 /* reshape_kernel.cpp */, + FC086D8520E7841E00D85EF7 /* lrn_kernel.cpp */, + FC086D8620E7841E00D85EF7 /* batchnorm_kernel.cpp */, + FC086D8720E7841E00D85EF7 /* multiclass_nms_kernel.cpp */, + ); + path = arm; + sourceTree = ""; + }; + FC086D8A20E7841E00D85EF7 /* framework */ = { + isa = PBXGroup; + children = ( + FC086D8B20E7841E00D85EF7 /* framework.pb-c.c */, + FC086D8C20E7841E00D85EF7 /* tensor_util.cpp */, + FC086D8D20E7841E00D85EF7 /* operator.h */, + FC086D8E20E7841E00D85EF7 /* op_info.h */, + FC086D8F20E7841E00D85EF7 /* operator.cpp */, + FC086D9020E7841E00D85EF7 /* ddim.cpp */, + FC086D9120E7841E00D85EF7 /* tensor_util.h */, + FC086D9220E7841E00D85EF7 /* variable.h */, + FC086D9320E7841E00D85EF7 /* scope.cpp */, + FC086D9420E7841E00D85EF7 /* data_layout.h */, + FC086D9520E7841E00D85EF7 /* lod_tensor.h */, + FC086D9620E7841E00D85EF7 /* dim.h */, + FC086D9720E7841E00D85EF7 /* framework.pb-c.h */, + FC086D9820E7841E00D85EF7 /* op_kernel_type.h */, + FC086D9920E7841E00D85EF7 /* attribute.cpp */, + FC086D9A20E7841E00D85EF7 /* op_proto_maker.h */, + FC086D9B20E7841E00D85EF7 /* program */, + FC086DAB20E7841E00D85EF7 /* lod_tensor.cpp */, + FC086DAC20E7841E00D85EF7 /* framework.proto */, + FC086DAD20E7841E00D85EF7 /* ddim.h */, + FC086DAE20E7841E00D85EF7 /* attribute.h */, + FC086DAF20E7841E00D85EF7 /* scope.h */, + FC086DB020E7841E00D85EF7 /* tensor.h */, + FC086DB120E7841E00D85EF7 /* op_registry.h */, + ); + path = framework; + sourceTree = ""; + }; + FC086D9B20E7841E00D85EF7 /* program */ = { + isa = PBXGroup; + children = ( + FC086D9C20E7841E00D85EF7 /* op_desc.cpp */, + FC086D9D20E7841E00D85EF7 /* program_desc.cpp */, + FC086D9E20E7841E00D85EF7 /* var_desc.h */, + FC086D9F20E7841E00D85EF7 /* program_desc.h */, + FC086DA020E7841E00D85EF7 /* op_desc.h */, + FC086DA120E7841E00D85EF7 /* program-optimize */, + FC086DA720E7841E00D85EF7 /* block_desc.cpp */, + FC086DA820E7841E00D85EF7 /* program.h */, + FC086DA920E7841E00D85EF7 /* tensor_desc.h */, + FC086DAA20E7841E00D85EF7 /* block_desc.h */, + ); + path = program; + sourceTree = ""; + }; + FC086DA120E7841E00D85EF7 /* program-optimize */ = { + isa = PBXGroup; + children = ( + FC086DA220E7841E00D85EF7 /* fusion_op_register.h */, + FC086DA320E7841E00D85EF7 /* node.cpp */, + FC086DA420E7841E00D85EF7 /* node.h */, + FC086DA520E7841E00D85EF7 /* program_optimize.h */, + FC086DA620E7841E00D85EF7 /* program_optimize.cpp */, + ); + path = "program-optimize"; + sourceTree = ""; + }; + FC086DB220E7841E00D85EF7 /* io */ = { + isa = PBXGroup; + children = ( + FC086DB320E7841E00D85EF7 /* io.cpp */, + FC086DB420E7841E00D85EF7 /* io.h */, + ); + path = io; + sourceTree = ""; + }; + FC086DB520E7841E00D85EF7 /* common */ = { + isa = PBXGroup; + children = ( + FC086DB620E7841E00D85EF7 /* types.cpp */, + FC086DB720E7841E00D85EF7 /* threadpool.h */, + FC086DB820E7841E00D85EF7 /* types.h */, + FC086DB920E7841E00D85EF7 /* protobuf-c.h */, + FC086DBA20E7841E00D85EF7 /* openmp-fix.cpp */, + FC086DBB20E7841E00D85EF7 /* dep_core.h */, + FC086DBC20E7841E00D85EF7 /* common.h */, + FC086DBD20E7841E00D85EF7 /* log.h */, + FC086DBE20E7841E00D85EF7 /* macros.h */, + FC086DBF20E7841E00D85EF7 /* type_define.h */, + FC086DC020E7841E00D85EF7 /* enforce.h */, + FC086DC120E7841E00D85EF7 /* protobuf-c.c */, + FC086DC220E7841E00D85EF7 /* variant.h */, + ); + path = common; + sourceTree = ""; + }; + FC086DC320E7841E00D85EF7 /* jni */ = { + isa = PBXGroup; + children = ( + FC086DC420E7841E00D85EF7 /* paddle_mobile_jni.cpp */, + FC086DC520E7841E00D85EF7 /* paddle_mobile_jni.h */, + ); + path = jni; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FC086BAE20E7839B00D85EF7 /* PaddleMobile */ = { + isa = PBXNativeTarget; + buildConfigurationList = FC086BB820E7839B00D85EF7 /* Build configuration list for PBXNativeTarget "PaddleMobile" */; + buildPhases = ( + FC086BAB20E7839B00D85EF7 /* Sources */, + FC086BAC20E7839B00D85EF7 /* Frameworks */, + FC086BAD20E7839B00D85EF7 /* CopyFiles */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PaddleMobile; + productName = PaddleMobile; + productReference = FC086BAF20E7839B00D85EF7 /* libPaddleMobile.a */; + productType = "com.apple.product-type.library.static"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FC086BA720E7839B00D85EF7 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0930; + ORGANIZATIONNAME = orange; + TargetAttributes = { + FC086BAE20E7839B00D85EF7 = { + CreatedOnToolsVersion = 9.3.1; + }; + }; + }; + buildConfigurationList = FC086BAA20E7839B00D85EF7 /* Build configuration list for PBXProject "PaddleMobile" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = FC086BA620E7839B00D85EF7; + productRefGroup = FC086BB020E7839B00D85EF7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FC086BAE20E7839B00D85EF7 /* PaddleMobile */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXSourcesBuildPhase section */ + FC086BAB20E7839B00D85EF7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FC086DCE20E7841E00D85EF7 /* transpose_op.cpp in Sources */, + FC086DD820E7841E00D85EF7 /* math_function.cpp in Sources */, + FC086DE120E7841E00D85EF7 /* relu_op.cpp in Sources */, + FC086E0920E7841E00D85EF7 /* multiclass_nms_kernel.cpp in Sources */, + FC086E0220E7841E00D85EF7 /* softmax_kernel.cpp in Sources */, + FC086DCD20E7841E00D85EF7 /* concat_op.cpp in Sources */, + FC086DCA20E7841E00D85EF7 /* feed_op.cpp in Sources */, + FC086DD920E7841E00D85EF7 /* pool_3x3.cpp in Sources */, + FC086DF020E7841E00D85EF7 /* pool_kernel.cpp in Sources */, + FC086E1A20E7841E00D85EF7 /* paddle_mobile_jni.cpp in Sources */, + FC086DF620E7841E00D85EF7 /* prior_box_kernel.cpp in Sources */, + FC086DC620E7841E00D85EF7 /* t_malloc.cpp in Sources */, + FC086DD320E7841E00D85EF7 /* elementwise_add_op.cpp in Sources */, + FC086E0E20E7841E00D85EF7 /* scope.cpp in Sources */, + FC086DDE20E7841E00D85EF7 /* fusion_conv_add.cpp in Sources */, + FC086DFF20E7841E00D85EF7 /* conv_add_relu_kernel.cpp in Sources */, + FC086DD720E7841E00D85EF7 /* vol2col.cpp in Sources */, + FC086E0B20E7841E00D85EF7 /* tensor_util.cpp in Sources */, + FC086E1320E7841E00D85EF7 /* program_optimize.cpp in Sources */, + FC086DF820E7841E00D85EF7 /* conv_add_bn_relu_kernel.cpp in Sources */, + FC086DC820E7841E00D85EF7 /* sigmoid_op.cpp in Sources */, + FC086E0D20E7841E00D85EF7 /* ddim.cpp in Sources */, + FC086E0120E7841E00D85EF7 /* depthwise_conv_kernel.cpp in Sources */, + FC086DDB20E7841E00D85EF7 /* depthwise_conv_3x3.cpp in Sources */, + FC086BB420E7839B00D85EF7 /* PaddleMobile.m in Sources */, + FC086E1420E7841E00D85EF7 /* block_desc.cpp in Sources */, + FC086DC920E7841E00D85EF7 /* box_coder_op.cpp in Sources */, + FC086DDF20E7841E00D85EF7 /* op_param.cpp in Sources */, + FC086DD520E7841E00D85EF7 /* pool_2x2.cpp in Sources */, + FC086DFD20E7841E00D85EF7 /* mul_kernel.cpp in Sources */, + FC086E0C20E7841E00D85EF7 /* operator.cpp in Sources */, + FC086DE020E7841E00D85EF7 /* mul_op.cpp in Sources */, + FC086E1520E7841E00D85EF7 /* lod_tensor.cpp in Sources */, + FC086DE720E7841E00D85EF7 /* acl_tensor.cc in Sources */, + FC086DDD20E7841E00D85EF7 /* fetch_op.cpp in Sources */, + FC086DE220E7841E00D85EF7 /* conv_op.cpp in Sources */, + FC086DDA20E7841E00D85EF7 /* pooling.cpp in Sources */, + FC086DEF20E7841E00D85EF7 /* concat_kernel.cpp in Sources */, + FC086DE520E7841E00D85EF7 /* pool_op.cpp in Sources */, + FC086DE820E7841E00D85EF7 /* acl_operator.cc in Sources */, + FC086DF220E7841E00D85EF7 /* lrn_kernel.cpp in Sources */, + FC086E0F20E7841E00D85EF7 /* attribute.cpp in Sources */, + FC086E0520E7841E00D85EF7 /* pool_kernel.cpp in Sources */, + FC086DDC20E7841E00D85EF7 /* softmax.cpp in Sources */, + FC086E0420E7841E00D85EF7 /* fusion_fc_kernel.cpp in Sources */, + FC086E1220E7841E00D85EF7 /* node.cpp in Sources */, + FC086E0820E7841E00D85EF7 /* batchnorm_kernel.cpp in Sources */, + FC086DCC20E7841E00D85EF7 /* reshape_op.cpp in Sources */, + FC086DE920E7841E00D85EF7 /* conv_kernel.cpp in Sources */, + FC086E1920E7841E00D85EF7 /* protobuf-c.c in Sources */, + FC086DF920E7841E00D85EF7 /* box_coder_kernel.cpp in Sources */, + FC086DF120E7841E00D85EF7 /* reshape_kernel.cpp in Sources */, + FC086DF720E7841E00D85EF7 /* conv_kernel.cpp in Sources */, + FC086DCF20E7841E00D85EF7 /* prior_box_op.cpp in Sources */, + FC086E1720E7841E00D85EF7 /* types.cpp in Sources */, + FC086DF320E7841E00D85EF7 /* fushion_fc_kernel.cpp in Sources */, + FC086DEB20E7841E00D85EF7 /* relu_kernel.cpp in Sources */, + FC086E0620E7841E00D85EF7 /* reshape_kernel.cpp in Sources */, + FC086E0720E7841E00D85EF7 /* lrn_kernel.cpp in Sources */, + FC086DE620E7841E00D85EF7 /* multiclass_nms_op.cpp in Sources */, + FC086E1120E7841E00D85EF7 /* program_desc.cpp in Sources */, + FC086E0320E7841E00D85EF7 /* concat_kernel.cpp in Sources */, + FC086DEC20E7841E00D85EF7 /* mul_kernel.cpp in Sources */, + FC086DFB20E7841E00D85EF7 /* sigmoid_kernel.cpp in Sources */, + FC086E1820E7841E00D85EF7 /* openmp-fix.cpp in Sources */, + FC086DF420E7841E00D85EF7 /* batchnorm_kernel.cpp in Sources */, + FC086DEA20E7841E00D85EF7 /* conv_add_kernel.cpp in Sources */, + FC086E1620E7841E00D85EF7 /* io.cpp in Sources */, + FC086DD620E7841E00D85EF7 /* im2col.cpp in Sources */, + FC086DC720E7841E00D85EF7 /* lrn_op.cpp in Sources */, + FC086DD220E7841E00D85EF7 /* depthwise_conv_op.cpp in Sources */, + FC086DFA20E7841E00D85EF7 /* conv_add_kernel.cpp in Sources */, + FC086E0A20E7841E00D85EF7 /* framework.pb-c.c in Sources */, + FC086DD020E7841E00D85EF7 /* fusion_conv_add_relu_op.cpp in Sources */, + FC086DCB20E7841E00D85EF7 /* fusion_conv_add_bn_relu_op.cpp in Sources */, + FC086DFC20E7841E00D85EF7 /* relu_kernel.cpp in Sources */, + FC086DE320E7841E00D85EF7 /* fusion_fc_op.cpp in Sources */, + FC086E0020E7841E00D85EF7 /* transpose_kernel.cpp in Sources */, + FC086DEE20E7841E00D85EF7 /* softmax_kernel.cpp in Sources */, + FC086DE420E7841E00D85EF7 /* batchnorm_op.cpp in Sources */, + FC086DED20E7841E00D85EF7 /* elementwise_add_kernel.cpp in Sources */, + FC086DF520E7841E00D85EF7 /* conv_kernel.cpp in Sources */, + FC086DD120E7841E00D85EF7 /* softmax_op.cpp in Sources */, + FC086E1020E7841E00D85EF7 /* op_desc.cpp in Sources */, + FC086DD420E7841E00D85EF7 /* gemm.cpp in Sources */, + FC086DFE20E7841E00D85EF7 /* elementwise_add_kernel.cpp in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin XCBuildConfiguration section */ + FC086BB620E7839B00D85EF7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + FC086BB720E7839B00D85EF7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FC086BB920E7839B00D85EF7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z5M2UUN5YV; + HEADER_SEARCH_PATHS = ../../src; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FC086BBA20E7839B00D85EF7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z5M2UUN5YV; + HEADER_SEARCH_PATHS = ../../src; + OTHER_LDFLAGS = "-ObjC"; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FC086BAA20E7839B00D85EF7 /* Build configuration list for PBXProject "PaddleMobile" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FC086BB620E7839B00D85EF7 /* Debug */, + FC086BB720E7839B00D85EF7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FC086BB820E7839B00D85EF7 /* Build configuration list for PBXNativeTarget "PaddleMobile" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FC086BB920E7839B00D85EF7 /* Debug */, + FC086BBA20E7839B00D85EF7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FC086BA720E7839B00D85EF7 /* Project object */; +} diff --git a/ios/PaddleMobile/PaddleMobile.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/PaddleMobile/PaddleMobile.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000000000000000000000000000000000..18f14d0d53b03b7326c6b613e445438ab35e4bed --- /dev/null +++ b/ios/PaddleMobile/PaddleMobile.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/PaddleMobile/PaddleMobile.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/PaddleMobile/PaddleMobile.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000000000000000000000000000000000..18d981003d68d0546c4804ac2ff47dd97c6e7921 --- /dev/null +++ b/ios/PaddleMobile/PaddleMobile.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/PaddleMobile/PaddleMobile.xcodeproj/project.xcworkspace/xcuserdata/liuruilong.xcuserdatad/UserInterfaceState.xcuserstate b/ios/PaddleMobile/PaddleMobile.xcodeproj/project.xcworkspace/xcuserdata/liuruilong.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..d1170b2289cb3302e40f5101b720bc835d08e7e1 Binary files /dev/null and b/ios/PaddleMobile/PaddleMobile.xcodeproj/project.xcworkspace/xcuserdata/liuruilong.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ios/PaddleMobile/PaddleMobile.xcodeproj/xcuserdata/liuruilong.xcuserdatad/xcschemes/xcschememanagement.plist b/ios/PaddleMobile/PaddleMobile.xcodeproj/xcuserdata/liuruilong.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000000000000000000000000000000000000..a877b7cd221cba607fdb31df85bfa008b95d988c --- /dev/null +++ b/ios/PaddleMobile/PaddleMobile.xcodeproj/xcuserdata/liuruilong.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + PaddleMobile.xcscheme + + orderHint + 1 + + + + diff --git a/ios/PaddleMobile/PaddleMobile/MacroDefine.h b/ios/PaddleMobile/PaddleMobile/MacroDefine.h new file mode 100644 index 0000000000000000000000000000000000000000..a09c420e87ec698345b6d1ffa4fd64c2c6ef9b47 --- /dev/null +++ b/ios/PaddleMobile/PaddleMobile/MacroDefine.h @@ -0,0 +1,13 @@ +// +// MacroDefine.h +// PaddleMobile +// +// Created by liuRuiLong on 2018/6/30. +// Copyright © 2018年 orange. All rights reserved. +// + +#ifndef MacroDefine_h +#define MacroDefine_h + + +#endif /* MacroDefine_h */ diff --git a/ios/PaddleMobile/PaddleMobile/PaddleMobile.h b/ios/PaddleMobile/PaddleMobile/PaddleMobile.h new file mode 100644 index 0000000000000000000000000000000000000000..3878c54c8a19a99e535bd8ad90eb1e19e28757c3 --- /dev/null +++ b/ios/PaddleMobile/PaddleMobile/PaddleMobile.h @@ -0,0 +1,26 @@ +/* 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. */ + +#import +#import + +@interface PaddleMobile : NSObject + ++ (instancetype)sharedInstance; +- (BOOL)load:(NSString *)modelPath andWeightsPath:(NSString *)weighsPath; +- (NSArray *)predict:(CGImageRef)image means:(NSArray *)means scale:(float)scale; +- (NSArray *)predict:(CGImageRef)image; +- (void)clear; + +@end diff --git a/ios/PaddleMobile/PaddleMobile/PaddleMobile.m b/ios/PaddleMobile/PaddleMobile/PaddleMobile.m new file mode 100644 index 0000000000000000000000000000000000000000..a350330b1d0fbf7072d35c41cab75da0b477c31d --- /dev/null +++ b/ios/PaddleMobile/PaddleMobile/PaddleMobile.m @@ -0,0 +1,43 @@ +/* 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. */ + +#import "PaddleMobile.h" + +@implementation PaddleMobile + ++ (instancetype)sharedInstance{ + //TODO: imp + exit(0); +} + +- (BOOL)load:(NSString *)modelPath andWeightsPath:(NSString *)weighsPath{ + //TODO: imp + exit(0); +} + +- (NSArray *)predict:(CGImageRef)image means:(NSArray *)means scale:(float)scale{ + //TODO: imp + exit(0); +} + +- (NSArray *)predict:(CGImageRef)image{ + //TODO: imp + exit(0); +} + +- (void)clear{ + //TODO: imp + exit(0); +} +@end diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.pbxproj b/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.pbxproj new file mode 100644 index 0000000000000000000000000000000000000000..e7e77ada15e84a6957a082c203c0121e118c5a3b --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.pbxproj @@ -0,0 +1,340 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 50; + objects = { + +/* Begin PBXBuildFile section */ + FC086BC920E783AF00D85EF7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = FC086BC820E783AF00D85EF7 /* AppDelegate.m */; }; + FC086BCC20E783AF00D85EF7 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FC086BCB20E783AF00D85EF7 /* ViewController.m */; }; + FC086BCF20E783AF00D85EF7 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FC086BCD20E783AF00D85EF7 /* Main.storyboard */; }; + FC086BD120E783B100D85EF7 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = FC086BD020E783B100D85EF7 /* Assets.xcassets */; }; + FC086BD420E783B100D85EF7 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = FC086BD220E783B100D85EF7 /* LaunchScreen.storyboard */; }; + FC086BD720E783B100D85EF7 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = FC086BD620E783B100D85EF7 /* main.m */; }; +/* End PBXBuildFile section */ + +/* Begin PBXFileReference section */ + FC086BC420E783AF00D85EF7 /* PaddleMobileDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PaddleMobileDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; + FC086BC720E783AF00D85EF7 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; + FC086BC820E783AF00D85EF7 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; + FC086BCA20E783AF00D85EF7 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; + FC086BCB20E783AF00D85EF7 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; + FC086BCE20E783AF00D85EF7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + FC086BD020E783B100D85EF7 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + FC086BD320E783B100D85EF7 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + FC086BD520E783B100D85EF7 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + FC086BD620E783B100D85EF7 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + FC086BC120E783AF00D85EF7 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + FC086BBB20E783AF00D85EF7 = { + isa = PBXGroup; + children = ( + FC086BC620E783AF00D85EF7 /* PaddleMobileDemo */, + FC086BC520E783AF00D85EF7 /* Products */, + ); + sourceTree = ""; + }; + FC086BC520E783AF00D85EF7 /* Products */ = { + isa = PBXGroup; + children = ( + FC086BC420E783AF00D85EF7 /* PaddleMobileDemo.app */, + ); + name = Products; + sourceTree = ""; + }; + FC086BC620E783AF00D85EF7 /* PaddleMobileDemo */ = { + isa = PBXGroup; + children = ( + FC086BC720E783AF00D85EF7 /* AppDelegate.h */, + FC086BC820E783AF00D85EF7 /* AppDelegate.m */, + FC086BCA20E783AF00D85EF7 /* ViewController.h */, + FC086BCB20E783AF00D85EF7 /* ViewController.m */, + FC086BCD20E783AF00D85EF7 /* Main.storyboard */, + FC086BD020E783B100D85EF7 /* Assets.xcassets */, + FC086BD220E783B100D85EF7 /* LaunchScreen.storyboard */, + FC086BD520E783B100D85EF7 /* Info.plist */, + FC086BD620E783B100D85EF7 /* main.m */, + ); + path = PaddleMobileDemo; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + FC086BC320E783AF00D85EF7 /* PaddleMobileDemo */ = { + isa = PBXNativeTarget; + buildConfigurationList = FC086BDA20E783B100D85EF7 /* Build configuration list for PBXNativeTarget "PaddleMobileDemo" */; + buildPhases = ( + FC086BC020E783AF00D85EF7 /* Sources */, + FC086BC120E783AF00D85EF7 /* Frameworks */, + FC086BC220E783AF00D85EF7 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = PaddleMobileDemo; + productName = PaddleMobileDemo; + productReference = FC086BC420E783AF00D85EF7 /* PaddleMobileDemo.app */; + productType = "com.apple.product-type.application"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + FC086BBC20E783AF00D85EF7 /* Project object */ = { + isa = PBXProject; + attributes = { + LastUpgradeCheck = 0930; + ORGANIZATIONNAME = orange; + TargetAttributes = { + FC086BC320E783AF00D85EF7 = { + CreatedOnToolsVersion = 9.3.1; + }; + }; + }; + buildConfigurationList = FC086BBF20E783AF00D85EF7 /* Build configuration list for PBXProject "PaddleMobileDemo" */; + compatibilityVersion = "Xcode 9.3"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = FC086BBB20E783AF00D85EF7; + productRefGroup = FC086BC520E783AF00D85EF7 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + FC086BC320E783AF00D85EF7 /* PaddleMobileDemo */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + FC086BC220E783AF00D85EF7 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FC086BD420E783B100D85EF7 /* LaunchScreen.storyboard in Resources */, + FC086BD120E783B100D85EF7 /* Assets.xcassets in Resources */, + FC086BCF20E783AF00D85EF7 /* Main.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + FC086BC020E783AF00D85EF7 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + FC086BCC20E783AF00D85EF7 /* ViewController.m in Sources */, + FC086BD720E783B100D85EF7 /* main.m in Sources */, + FC086BC920E783AF00D85EF7 /* AppDelegate.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXVariantGroup section */ + FC086BCD20E783AF00D85EF7 /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FC086BCE20E783AF00D85EF7 /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + FC086BD220E783B100D85EF7 /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + FC086BD320E783B100D85EF7 /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + FC086BD820E783B100D85EF7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.3; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + }; + name = Debug; + }; + FC086BD920E783B100D85EF7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_ENABLE_OBJC_WEAK = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.3; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + FC086BDB20E783B100D85EF7 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z5M2UUN5YV; + INFOPLIST_FILE = PaddleMobileDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = orange.PaddleMobileDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + FC086BDC20E783B100D85EF7 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = Z5M2UUN5YV; + INFOPLIST_FILE = PaddleMobileDemo/Info.plist; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = orange.PaddleMobileDemo; + PRODUCT_NAME = "$(TARGET_NAME)"; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + FC086BBF20E783AF00D85EF7 /* Build configuration list for PBXProject "PaddleMobileDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FC086BD820E783B100D85EF7 /* Debug */, + FC086BD920E783B100D85EF7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + FC086BDA20E783B100D85EF7 /* Build configuration list for PBXNativeTarget "PaddleMobileDemo" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + FC086BDB20E783B100D85EF7 /* Debug */, + FC086BDC20E783B100D85EF7 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = FC086BBC20E783AF00D85EF7 /* Project object */; +} diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000000000000000000000000000000000000..e4db9529ba656814e6a2bd889426662d914277eb --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000000000000000000000000000000000000..18d981003d68d0546c4804ac2ff47dd97c6e7921 --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.xcworkspace/xcuserdata/liuruilong.xcuserdatad/UserInterfaceState.xcuserstate b/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.xcworkspace/xcuserdata/liuruilong.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000000000000000000000000000000000000..69b699dbf553971a96471ef864e4e848c9b17e12 Binary files /dev/null and b/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/project.xcworkspace/xcuserdata/liuruilong.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/xcuserdata/liuruilong.xcuserdatad/xcschemes/xcschememanagement.plist b/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/xcuserdata/liuruilong.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000000000000000000000000000000000000..7caa9222e77f1e53c0ee45c298aacb330e870688 --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo.xcodeproj/xcuserdata/liuruilong.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + PaddleMobileDemo.xcscheme + + orderHint + 0 + + + + diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo/AppDelegate.h b/ios/PaddleMobileDemo/PaddleMobileDemo/AppDelegate.h new file mode 100644 index 0000000000000000000000000000000000000000..eb789ffbb2d394d9c45651b48a931d3759a7687b --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo/AppDelegate.h @@ -0,0 +1,23 @@ +/* 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. */ + +#import + +@interface AppDelegate : UIResponder + +@property (strong, nonatomic) UIWindow *window; + + +@end + diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo/AppDelegate.m b/ios/PaddleMobileDemo/PaddleMobileDemo/AppDelegate.m new file mode 100644 index 0000000000000000000000000000000000000000..12cc19636b43f7fc3634736c4b551b4aba29ce73 --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo/AppDelegate.m @@ -0,0 +1,57 @@ +/* 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. */ + +#import "AppDelegate.h" + +@interface AppDelegate () + +@end + +@implementation AppDelegate + + +- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { + // Override point for customization after application launch. + return YES; +} + + +- (void)applicationWillResignActive:(UIApplication *)application { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. +} + + +- (void)applicationDidEnterBackground:(UIApplication *)application { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. +} + + +- (void)applicationWillEnterForeground:(UIApplication *)application { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. +} + + +- (void)applicationDidBecomeActive:(UIApplication *)application { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. +} + + +- (void)applicationWillTerminate:(UIApplication *)application { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. +} + + +@end diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/ios/PaddleMobileDemo/PaddleMobileDemo/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..d8db8d65fd79fd541b2b7eba75c7378af3448f9c --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo/Assets.xcassets/Contents.json b/ios/PaddleMobileDemo/PaddleMobileDemo/Assets.xcassets/Contents.json new file mode 100644 index 0000000000000000000000000000000000000000..da4a164c918651cdd1e11dca5cc62c333f097601 --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo/Base.lproj/LaunchScreen.storyboard b/ios/PaddleMobileDemo/PaddleMobileDemo/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000000000000000000000000000000000000..f83f6fd5810b9c852cf98563d82d5ed1e84ff893 --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo/Base.lproj/Main.storyboard b/ios/PaddleMobileDemo/PaddleMobileDemo/Base.lproj/Main.storyboard new file mode 100644 index 0000000000000000000000000000000000000000..d7c78a1255c016bde922c849eef8555881c207b6 --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo/Base.lproj/Main.storyboard @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo/Info.plist b/ios/PaddleMobileDemo/PaddleMobileDemo/Info.plist new file mode 100644 index 0000000000000000000000000000000000000000..16be3b681122de83e380d47b840b7d0486f71f86 --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo/ViewController.h b/ios/PaddleMobileDemo/PaddleMobileDemo/ViewController.h new file mode 100644 index 0000000000000000000000000000000000000000..092a369366b4f28e88eaac6032b60f18a332ba84 --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo/ViewController.h @@ -0,0 +1,21 @@ +/* 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. */ + +#import + +@interface ViewController : UIViewController + + +@end + diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo/ViewController.m b/ios/PaddleMobileDemo/PaddleMobileDemo/ViewController.m new file mode 100644 index 0000000000000000000000000000000000000000..369e90039d37f62545a20ae30b5ce47d1c27dc95 --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo/ViewController.m @@ -0,0 +1,33 @@ +/* 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. */ + +#import "ViewController.h" + +@interface ViewController () + +@end + +@implementation ViewController + +- (void)viewDidLoad { + [super viewDidLoad]; +} + + +- (void)didReceiveMemoryWarning { + [super didReceiveMemoryWarning]; +} + + +@end diff --git a/ios/PaddleMobileDemo/PaddleMobileDemo/main.m b/ios/PaddleMobileDemo/PaddleMobileDemo/main.m new file mode 100644 index 0000000000000000000000000000000000000000..8429e87bd1fba3a2e7070db56b458f2656b9bfa6 --- /dev/null +++ b/ios/PaddleMobileDemo/PaddleMobileDemo/main.m @@ -0,0 +1,22 @@ +/* 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. */ + +#import +#import "AppDelegate.h" + +int main(int argc, char * argv[]) { + @autoreleasepool { + return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); + } +} diff --git a/src/common/log.h b/src/common/log.h index faab6b31a31d7ce7148f96630900aff82931c771..d964d9c1b39a7e72e3d757ef2be0737fd1d25f94 100644 --- a/src/common/log.h +++ b/src/common/log.h @@ -174,7 +174,10 @@ struct ToLog; struct Print { friend struct ToLog; template - Print &operator<<(T const &value) {} + Print &operator<<(T const &value) { + Print p = Print(); + return p; + } private: }; diff --git a/src/common/types.cpp b/src/common/types.cpp index 8e8084fc57dafb22c55aa88462d69b2b31cbe1fa..cea42171f0205e0d40b2703d5c90f0b9fc253e68 100644 --- a/src/common/types.cpp +++ b/src/common/types.cpp @@ -23,8 +23,9 @@ const std::string G_OP_TYPE_BOX_CODER = "box_coder"; const std::string G_OP_TYPE_CONCAT = "concat"; const std::string G_OP_TYPE_ELEMENTWISE_ADD = "elementwise_add"; const std::string G_OP_TYPE_FUSION_CONV_ADD_RELU = "fusion_conv_add_relu"; -const std::string G_OP_TYPE_FC = "fc"; -const std::string G_OP_TYPE_CONV_ADD = "conv_add"; +const std::string G_OP_TYPE_FUSION_CONV_ADD_BN_RELU = "fusion_conv_add_bn_relu"; +const std::string G_OP_TYPE_FC = "fusion_fc"; +const std::string G_OP_TYPE_FUSION_CONV_ADD = "fusion_conv_add"; const std::string G_OP_TYPE_LRN = "lrn"; const std::string G_OP_TYPE_MUL = "mul"; const std::string G_OP_TYPE_MULTICLASS_NMS = "multiclass_nms"; @@ -46,7 +47,7 @@ std::unordered_map< std::string, std::pair, std::vector>> op_input_output_key = { {G_OP_TYPE_CONV, {{"Input"}, {"Output"}}}, - {G_OP_TYPE_CONV_ADD, {{"Input"}, {"Out"}}}, + {G_OP_TYPE_FUSION_CONV_ADD, {{"Input"}, {"Out"}}}, {G_OP_TYPE_RELU, {{"X"}, {"Out"}}}, {G_OP_TYPE_SOFTMAX, {{"X"}, {"Out"}}}, {G_OP_TYPE_MUL, {{"X"}, {"Out"}}}, @@ -61,6 +62,7 @@ std::unordered_map< {G_OP_TYPE_TRANSPOSE, {{"X"}, {"Out"}}}, {G_OP_TYPE_BOX_CODER, {{"PriorBox", "PriorBoxVar", "TargetBox"}, {"OutputBox"}}}, + {G_OP_TYPE_FUSION_CONV_ADD_BN_RELU, {{"Input"}, {"Out"}}}, {G_OP_TYPE_PRIOR_BOX, {{"Image", "Input"}, {"Boxes", "Variances"}}}, {G_OP_TYPE_MULTICLASS_NMS, {{"BBoxes", "Scores"}, {"Out"}}}, {G_OP_TYPE_FC, {{"X", "Y", "Z"}, {"Out"}}}, diff --git a/src/common/types.h b/src/common/types.h index 045de236ed93b4c37e3ac058ea1d7b548f83e9fc..ec428b9911f64d7ccc8c6f5dc4be7f970e855d3c 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -79,7 +79,9 @@ extern const std::string G_OP_TYPE_CONCAT; extern const std::string G_OP_TYPE_ELEMENTWISE_ADD; extern const std::string G_OP_TYPE_FUSION_CONV_ADD_RELU; extern const std::string G_OP_TYPE_FC; -extern const std::string G_OP_TYPE_CONV_ADD; +extern const std::string G_OP_TYPE_FUSION_CONV_ADD; +extern const std::string G_OP_TYPE_FUSION_CONV_ADD_BN_RELU; + extern const std::string G_OP_TYPE_LRN; extern const std::string G_OP_TYPE_MUL; extern const std::string G_OP_TYPE_MULTICLASS_NMS; diff --git a/src/common/variant.h b/src/common/variant.h index 7fbf0ec0772f102165770dc9c8e053f469965f10..b87a5e67a76f4c616f2c450ef4527bcf6c16286b 100644 --- a/src/common/variant.h +++ b/src/common/variant.h @@ -83,6 +83,7 @@ struct Variant { return *const_cast(reinterpret_cast(&data)); } else { PADDLE_MOBILE_THROW_EXCEPTION(" bad cast in variant "); + exit(0); } } diff --git a/src/framework/attribute.h b/src/framework/attribute.h index 478fc1b3f5ae95d9720b057d3ab0d2e8912e7093..f0519a35b3ed2a02e35f1ef0d6a718efb7b76095 100644 --- a/src/framework/attribute.h +++ b/src/framework/attribute.h @@ -129,6 +129,7 @@ class Attribute { return vistor(attr.variant_.Get()); } else { PADDLE_MOBILE_THROW_EXCEPTION("type not support"); + exit(0); } } diff --git a/src/framework/data_layout.h b/src/framework/data_layout.h index 3b31445707a887a2715afd0b9e7192ad76724351..f1249008f088dce48ed040e47900121c2eb41af1 100644 --- a/src/framework/data_layout.h +++ b/src/framework/data_layout.h @@ -40,6 +40,7 @@ inline DataLayout StringToDataLayout(const std::string &str) { return DataLayout::kAnyLayout; } else { PADDLE_MOBILE_THROW_EXCEPTION("Unknown storage order string: %s", s.c_str()) + exit(0); } } @@ -52,6 +53,8 @@ inline std::string DataLayoutToString(const DataLayout &data_layout) { case DataLayout::kAnyLayout: return "ANY_LAYOUT"; default: + PADDLE_MOBILE_THROW_EXCEPTION("Unknown storage order string ") + exit(0); break; } } diff --git a/src/framework/ddim.h b/src/framework/ddim.h index ff94c24adac5bea1fd4c7a80857b212056c06d36..833bc2783f855fd9d6df50d21345539fbe2ca6c4 100644 --- a/src/framework/ddim.h +++ b/src/framework/ddim.h @@ -58,7 +58,8 @@ struct DDim { } else if (d.var.TypeId() == typeid(Dim<9>).hash_code()) { return vistor(d.var.Get>()); } else { - DLOG << " dim not support"; + PADDLE_MOBILE_ENFORCE(false, " dim not support"); + exit(0); } } diff --git a/src/framework/dim.h b/src/framework/dim.h index 38e62df99519c3e869dc0fd2ae71beed28370122..dd7610de65d4a4c93402cf49b0fdbdc7995610c0 100644 --- a/src/framework/dim.h +++ b/src/framework/dim.h @@ -129,6 +129,7 @@ int64_t &indexer(Dim &dim, int idx) { template <> int64_t &indexer<0>(Dim<0> &dim, int idx) { PADDLE_MOBILE_THROW_EXCEPTION("Invalid index") + exit(0); } template @@ -145,6 +146,7 @@ int64_t indexer(const Dim &dim, int idx) { template <> int64_t indexer<0>(const Dim<0> &dim, int idx) { PADDLE_MOBILE_THROW_EXCEPTION("Invalid index") + exit(0); } } // namespace diff --git a/src/framework/operator.h b/src/framework/operator.h index c68744a676030413e81570ded0db5671cdf4ba7a..793551b0cd3eea290243c156c27616a34c37a3d2 100644 --- a/src/framework/operator.h +++ b/src/framework/operator.h @@ -63,7 +63,7 @@ class OperatorBase { std::vector GetOutKeys() const; virtual void RunImpl() const = 0; - virtual void Init() const = 0; + virtual void Init() = 0; /* * @b op 运算所需的输入, 如上一层的输出结果、卷积核 * */ @@ -117,8 +117,8 @@ class OperatorWithKernel : public OperatorBase { virtual void InferShape() const = 0; - void Init() const { - PADDLE_MOBILE_ENFORCE(kernel_.Init(param_), " %s kernel init failed", + void Init() { + PADDLE_MOBILE_ENFORCE(kernel_.Init(¶m_), " %s kernel init failed", this->type_.c_str()); } @@ -146,7 +146,7 @@ class OpKernelBase { } #endif virtual void Compute(const P ¶) const = 0; - virtual bool Init(const P ¶) const { return true; }; + virtual bool Init(P *para) { return true; }; virtual ~OpKernelBase() = default; private: diff --git a/src/framework/program/program-optimize/node.cpp b/src/framework/program/program-optimize/node.cpp index 89385e12d9c5f20a21f6ee6f3987c088c4b15563..e635e07eaf4484c3e390101c3b43fdaf24bbd2c6 100644 --- a/src/framework/program/program-optimize/node.cpp +++ b/src/framework/program/program-optimize/node.cpp @@ -93,7 +93,8 @@ int Node::Depth(int begin) { Node &Node::Folder( int size, std::string type, - std::map> change, + std::map>> + change, std::vector> *removed_nodes) { std::shared_ptr op_desc = std::make_shared(); @@ -110,12 +111,15 @@ Node &Node::Folder( void Node::Folder( std::shared_ptr op_desc, std::vector> *outputs, int index, - std::map> *change, + std::map>> + *change, Node *begin_node, std::vector> *removed_nodes) { if (change->find(this->type_) != change->end()) { - auto change_pair = (*change)[this->type_]; - op_desc->GetInputs()[change_pair.second] = - this->op_desc_->GetInputs()[change_pair.first]; + auto change_pairs = (*change)[this->type_]; + for (const auto &change_pair : change_pairs) { + op_desc->GetInputs()[change_pair.second] = + this->op_desc_->GetInputs()[change_pair.first]; + } } for (auto &attr_pair : this->op_desc_->attrs_) { diff --git a/src/framework/program/program-optimize/node.h b/src/framework/program/program-optimize/node.h index 7236ffdd1782dfb39af73195da9b3756030c9117..88bf1e16ed2a5fb3a038eadd546d63ffb3916f68 100644 --- a/src/framework/program/program-optimize/node.h +++ b/src/framework/program/program-optimize/node.h @@ -17,6 +17,7 @@ limitations under the License. */ #include #include #include +#include #include #include "common/log.h" #include "framework/program/op_desc.h" @@ -43,7 +44,8 @@ class Node { int Depth(int begin = 0); Node &Folder( int size, std::string type, - std::map> change_map, + std::map>> + change, std::vector> *removed_nodes); std::vector> OpDescs(int size); std::shared_ptr OpDescOfNode() { return op_desc_; } @@ -56,7 +58,8 @@ class Node { void Folder( std::shared_ptr op_desc, std::vector> *outputs, int index, - std::map> *change, + std::map>> + *change, Node *begin_node, std::vector> *removed_nodes); std::shared_ptr op_desc_; #ifdef PADDLE_MOBILE_DEBUG diff --git a/src/operators/feed_op.h b/src/operators/feed_op.h index bd5fd8cb32d484b7f76652139603f6b0f1b4b5d7..8753bfa9375f50930f9ec57e1b48b26c127edbc6 100644 --- a/src/operators/feed_op.h +++ b/src/operators/feed_op.h @@ -32,7 +32,7 @@ class FeedOp : public framework::OperatorBase { param_(inputs, outputs, attrs, *scope) {} void RunImpl() const { param_.Out()->ShareDataWith(*param_.InputX()); } - void Init() const {} + void Init() {} void InferShape() const { auto out_dims = param_.Out()->dims(); diff --git a/src/operators/fetch_op.h b/src/operators/fetch_op.h index 4b3680b58357d8295b1b6acf111d3573d4e4d1bd..b46093e18e1d92ed9dacbdb456bb591d0c546456 100644 --- a/src/operators/fetch_op.h +++ b/src/operators/fetch_op.h @@ -33,7 +33,7 @@ class FetchOp : public framework::OperatorBase { param_(inputs, outputs, attrs, *scope) {} void RunImpl() const { param_.Out()->ShareDataWith(*param_.InputX()); } - void Init() const {} + void Init() {} void InferShape() const { auto x_dims = param_.InputX()->dims(); diff --git a/src/operators/fusion_conv_add.cpp b/src/operators/fusion_conv_add.cpp index 4c01603509b0a1d9da2c2dc31a38719d5117e05c..731bb66cb058dd8562b5fc9257bd8e9ed5f9c0af 100644 --- a/src/operators/fusion_conv_add.cpp +++ b/src/operators/fusion_conv_add.cpp @@ -50,8 +50,8 @@ template class FusionConvAddOp; namespace ops = paddle_mobile::operators; #ifdef PADDLE_MOBILE_CPU -USE_OP_CPU(conv_add); -REGISTER_OPERATOR_CPU(conv_add, ops::FusionConvAddOp); +USE_OP_CPU(fusion_conv_add); +REGISTER_OPERATOR_CPU(fusion_conv_add, ops::FusionConvAddOp); #endif #ifdef PADDLE_MOBILE_MALI_GPU USE_OP_MALI_GPU(conv_add); diff --git a/src/operators/fusion_conv_add.h b/src/operators/fusion_conv_add.h index 73107a3c0adc382dea98663188215ad295c4506b..8b843f55266300b9fbb758b2b5ce43b908d1dc82 100644 --- a/src/operators/fusion_conv_add.h +++ b/src/operators/fusion_conv_add.h @@ -39,10 +39,10 @@ class FusionConvAddMatcher : public framework::FusionOpMatcher { vector> origin_descs = node->OpDescs(node_.Depth()); node->Folder(node_.Depth(), Type(), - {{G_OP_TYPE_ELEMENTWISE_ADD, {"Y", "Y"}}}, removed_nodes); + {{G_OP_TYPE_ELEMENTWISE_ADD, {{"Y", "Y"}}}}, removed_nodes); } - std::string Type() { return G_OP_TYPE_CONV_ADD; } + std::string Type() { return G_OP_TYPE_FUSION_CONV_ADD; } }; template @@ -67,11 +67,13 @@ class FusionConvAddOp : public framework::OperatorWithKernel< }; #ifdef PADDLE_MOBILE_CPU + #ifndef CONV_ADD_REGISTER static framework::FusionOpRegistrar convadd_registrar( new FusionConvAddMatcher()); #define CONV_ADD_REGISTER #endif + #endif #ifdef PADDLE_MOBILE_MALI_GPU diff --git a/src/operators/fusion_conv_add_bn_relu_op.cpp b/src/operators/fusion_conv_add_bn_relu_op.cpp new file mode 100644 index 0000000000000000000000000000000000000000..63d0b23444ae6bf625e5e8640d3dc2ad314917d2 --- /dev/null +++ b/src/operators/fusion_conv_add_bn_relu_op.cpp @@ -0,0 +1,61 @@ +/* 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 FUSION_CONVADDBNRELU_OP + +#include "operators/fusion_conv_add_bn_relu_op.h" +#include "operators/math/conv_func.h" + +namespace paddle_mobile { +namespace operators { + +template +void FusionConvAddBNReluOp::InferShape() const { + auto in_dims = this->param_.Input()->dims(); + auto filter_dims = this->param_.Filter()->dims(); + const std::vector &strides = this->param_.Strides(); + std::vector paddings = this->param_.Paddings(); + int groups = this->param_.Groups(); + std::vector dilations = this->param_.Dilations(); + + PADDLE_MOBILE_ENFORCE((in_dims.size() == filter_dims.size() && + dilations.size() == paddings.size() && + paddings.size() == strides.size()), + "ConvParam is not suitable"); + + std::vector output_shape({in_dims[0], filter_dims[0]}); + for (size_t i = 0; i < strides.size(); ++i) { + output_shape.push_back( + math::ConvOutputSize(in_dims[i + 2], filter_dims[i + 2], dilations[i], + paddings[i], strides[i])); + } + + framework::DDim ddim = framework::make_ddim(output_shape); + this->param_.Output()->Resize(ddim); +} +template class FusionConvAddBNReluOp; +} // namespace operators +} // namespace paddle_mobile + +namespace ops = paddle_mobile::operators; +#ifdef PADDLE_MOBILE_CPU +USE_OP_CPU(fusion_conv_add_bn_relu); +REGISTER_OPERATOR_CPU(fusion_conv_add_bn_relu, ops::FusionConvAddBNReluOp); +#endif +#ifdef PADDLE_MOBILE_MALI_GPU +#endif +#ifdef PADDLE_MOBILE_FPGA +#endif + +#endif diff --git a/src/operators/fusion_conv_add_bn_relu_op.h b/src/operators/fusion_conv_add_bn_relu_op.h new file mode 100644 index 0000000000000000000000000000000000000000..494e49280dbdc3fe778cd7bdf5f5d30a82f2d9ff --- /dev/null +++ b/src/operators/fusion_conv_add_bn_relu_op.h @@ -0,0 +1,106 @@ +/* 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 FUSION_CONVADDBNRELU_OP + +#pragma once + +#include +#include +#include "framework/operator.h" +#include "framework/program/program-optimize/fusion_op_register.h" +#include "op_param.h" +#include "operators/kernel/conv_add_bn_relu_kernel.h" + +namespace paddle_mobile { +namespace operators { +using std::string; +using std::vector; +class FusionConvAddBNReluMatcher : public framework::FusionOpMatcher { + public: + FusionConvAddBNReluMatcher() { + node_ = framework::Node(G_OP_TYPE_CONV); + node_ > std::make_shared(G_OP_TYPE_ELEMENTWISE_ADD) > + std::make_shared(G_OP_TYPE_BATCHNORM) > + std::make_shared(G_OP_TYPE_RELU); + } + + void FolderNodes( + framework::Node *node, + std::vector> *removed_nodes) { + vector> origin_descs = + node->OpDescs(node_.Depth()); + node->Folder(node_.Depth(), Type(), + {{G_OP_TYPE_ELEMENTWISE_ADD, {{"Y", "Y"}}}, + {G_OP_TYPE_BATCHNORM, + {{"Scale", "Scale"}, + {"Mean", "Mean"}, + {"Bias", "Bias"}, + {"Variance", "Variance"}}}}, + removed_nodes); + } + + std::string Type() { return G_OP_TYPE_FUSION_CONV_ADD_BN_RELU; } +}; + +template +class FusionConvAddBNReluOp + : public framework::OperatorWithKernel< + DeviceType, FusionConvAddBNReluParam, + operators::ConvAddBNReluKernel> { + public: + FusionConvAddBNReluOp(const string &type, const VariableNameMap &inputs, + const VariableNameMap &outputs, + const framework::AttributeMap &attrs, + std::shared_ptr scope) + : framework::OperatorWithKernel< + DeviceType, FusionConvAddBNReluParam, + operators::ConvAddBNReluKernel>( + type, inputs, outputs, attrs, scope) {} + + using framework::OperatorWithKernel< + DeviceType, FusionConvAddBNReluParam, + operators::ConvAddBNReluKernel>::OperatorWithKernel; + void InferShape() const override; + + protected: +}; + +#ifdef PADDLE_MOBILE_CPU + +//#ifndef FUSION_CONV_ADD_BN_RELU_REGISTER +// static framework::FusionOpRegistrar fusion_conv_add_bn_relu_registrar( +// new FusionConvAddBNReluMatcher()); +//#define FUSION_CONV_ADD_BN_RELU_REGISTER +//#endif + +#endif + +#ifdef PADDLE_MOBILE_MALI_GPU + +#ifndef FUSION_CONV_ADD_BN_RELU_REGISTER +static framework::FusionOpRegistrar fusion_conv_add_bn_relu_registrar( + new FusionConvAddBNReluMatcher()); +#define FUSION_CONV_ADD_BN_RELU_REGISTER +#endif + +#endif + +#ifdef PADDLE_MOBILE_FPGA +#endif + +} // namespace operators +} // namespace paddle_mobile + +#endif diff --git a/src/operators/fusion_conv_add_relu_op.h b/src/operators/fusion_conv_add_relu_op.h index fd27005c8bef8f8cb91fbf5b6e5a852306c28a9b..bcacb3da3e2ec5371021f3552ffd2c9f53947874 100644 --- a/src/operators/fusion_conv_add_relu_op.h +++ b/src/operators/fusion_conv_add_relu_op.h @@ -36,7 +36,7 @@ class FusionConvAddReluOpMatcher : public framework::FusionOpMatcher { framework::Node *node, std::vector> *removed_nodes) { node->Folder(node_.Depth(), Type(), - {{G_OP_TYPE_ELEMENTWISE_ADD, {"Y", "Y"}}}, removed_nodes); + {{G_OP_TYPE_ELEMENTWISE_ADD, {{"Y", "Y"}}}}, removed_nodes); } std::string Type() { return G_OP_TYPE_FUSION_CONV_ADD_RELU; } }; @@ -65,11 +65,11 @@ class FusionConvAddReluOp : public framework::OperatorWithKernel< #ifdef PADDLE_MOBILE_CPU -#ifndef CONV_ADD_RELU_REGISTER -#define CONV_ADD_RELU_REGISTER +//#ifndef CONV_ADD_RELU_REGISTER +//#define CONV_ADD_RELU_REGISTER // static framework::FusionOpRegistrar fusion_conv_add_relu_registrar(new // FusionConvAddReluOpMatcher()); -#endif +//#endif #endif #ifdef PADDLE_MOBILE_MALI_GPU diff --git a/src/operators/fusion_fc_op.cpp b/src/operators/fusion_fc_op.cpp index fae561348899dadc4c25f84ec3a0993d9ae693f9..2e591b678cf7987eba5fdc74643cd7e15c35271f 100644 --- a/src/operators/fusion_fc_op.cpp +++ b/src/operators/fusion_fc_op.cpp @@ -55,8 +55,8 @@ template class FusionFcOp; namespace ops = paddle_mobile::operators; #ifdef PADDLE_MOBILE_CPU -USE_OP_CPU(fc); -REGISTER_OPERATOR_CPU(fc, ops::FusionFcOp); +USE_OP_CPU(fusion_fc); +REGISTER_OPERATOR_CPU(fusion_fc, ops::FusionFcOp); #endif #ifdef PADDLE_MOBILE_MALI_GPU USE_OP_MALI_GPU(fc); diff --git a/src/operators/fusion_fc_op.h b/src/operators/fusion_fc_op.h index 0ca4d2b27ad46b77ddba55b6b377e741c97bdc9e..ea1f42f0adfb532982f50c2da41fc58f63b54834 100644 --- a/src/operators/fusion_fc_op.h +++ b/src/operators/fusion_fc_op.h @@ -38,7 +38,7 @@ class FusionFcMatcher : public framework::FusionOpMatcher { framework::Node *node, std::vector> *removed_nodes) { node->Folder(node_.Depth(), Type(), - {{G_OP_TYPE_ELEMENTWISE_ADD, {"Y", "Z"}}}, removed_nodes); + {{G_OP_TYPE_ELEMENTWISE_ADD, {{"Y", "Z"}}}}, removed_nodes); } std::string Type() { return G_OP_TYPE_FC; } @@ -66,17 +66,21 @@ class FusionFcOp }; #ifdef PADDLE_MOBILE_CPU + #ifndef CONV_CPU_REGISTER #define CONV_CPU_REGISTER static framework::FusionOpRegistrar fc_registrar(new FusionFcMatcher()); #endif + #endif #ifdef PADDLE_MOBILE_MALI_GPU + #ifndef CONV_CPU_REGISTER #define CONV_CPU_REGISTER static framework::FusionOpRegistrar fc_registrar(new FusionFcMatcher()); #endif + #endif #ifdef PADDLE_MOBILE_FPGA diff --git a/src/operators/kernel/arm/batchnorm_kernel.cpp b/src/operators/kernel/arm/batchnorm_kernel.cpp index 964bf71f451e2ca48d3742ed5151e9784c516d5c..f78d1fdc95ac9e10619dbf32fdc84d01a370f315 100644 --- a/src/operators/kernel/arm/batchnorm_kernel.cpp +++ b/src/operators/kernel/arm/batchnorm_kernel.cpp @@ -21,7 +21,7 @@ namespace paddle_mobile { namespace operators { template <> -bool BatchNormKernel::Init(const BatchNormParam ¶) const { +bool BatchNormKernel::Init(BatchNormParam *param) { return true; } diff --git a/src/operators/kernel/arm/box_coder_kernel.cpp b/src/operators/kernel/arm/box_coder_kernel.cpp index df0a75f357658736ede4265a6cc57db30afee1d4..fb113b16f53bcd1b9fca7a1dbbf94a846e9a0f81 100644 --- a/src/operators/kernel/arm/box_coder_kernel.cpp +++ b/src/operators/kernel/arm/box_coder_kernel.cpp @@ -111,7 +111,7 @@ void DecodeCenterSize(const framework::Tensor& target_box, } template <> -bool BoxCoderKernel::Init(const BoxCoderParam& para) const { +bool BoxCoderKernel::Init(BoxCoderParam* param) { return true; } diff --git a/src/operators/kernel/arm/concat_kernel.cpp b/src/operators/kernel/arm/concat_kernel.cpp index 0312047b8e8af1eb9dad57c751e392e8a5054878..5daf3e104a04025165ce7281f3a16d8e3f9cb522 100644 --- a/src/operators/kernel/arm/concat_kernel.cpp +++ b/src/operators/kernel/arm/concat_kernel.cpp @@ -53,7 +53,7 @@ class ConcatFunctor { }; template <> -bool ConcatKernel::Init(const ConcatParam ¶) const { +bool ConcatKernel::Init(ConcatParam *param) { return true; } diff --git a/src/operators/kernel/arm/conv_add_bn_relu_kernel.cpp b/src/operators/kernel/arm/conv_add_bn_relu_kernel.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e95bd8e76c5034f3897eff81e0ba67119d04a95b --- /dev/null +++ b/src/operators/kernel/arm/conv_add_bn_relu_kernel.cpp @@ -0,0 +1,65 @@ +/* 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 FUSION_CONVADDBNRELU_OP + +#include "operators/kernel/conv_add_bn_relu_kernel.h" +#include "operators/kernel/central-arm-func/conv_add_bn_relu_func.h" + +namespace paddle_mobile { +namespace operators { + +template <> +bool ConvAddBNReluKernel::Init(FusionConvAddBNReluParam *param) { + const Tensor *mean = (*param).InputMean(); + const Tensor *variance = (*param).InputVariance(); + const Tensor *scale = (*param).InputScale(); + const Tensor *bias = (*param).InputBias(); + const float epsilon = (*param).Epsilon(); + + auto mean_ptr = mean->data(); + auto variance_ptr = variance->data(); + auto scale_ptr = scale->data(); + auto bias_ptr = bias->data(); + + const int C = mean->numel(); + float inv_std_ptr[C]; + for (int i = 0; i < C; i++) { + inv_std_ptr[i] = + 1 / static_cast(pow((variance_ptr[i] + epsilon), 0.5)); + } + Tensor *new_scale = new Tensor(); + Tensor *new_bias = new Tensor(); + auto new_scale_ptr = new_scale->mutable_data({C}); + auto new_bias_ptr = new_bias->mutable_data({C}); + for (int i = 0; i < C; i++) { + new_scale_ptr[i] = inv_std_ptr[i] * scale_ptr[i]; + new_bias_ptr[i] = bias_ptr[i] - mean_ptr[i] * inv_std_ptr[i] * scale_ptr[i]; + } + (*param).SetNewScale(new_scale); + (*param).SetNewBias(new_bias); + return true; +} + +template <> +void ConvAddBNReluKernel::Compute( + const FusionConvAddBNReluParam ¶m) const { + ConvAddBNReluCompute(param); +} +template class ConvAddBNReluKernel; + +} // namespace operators +} // namespace paddle_mobile + +#endif diff --git a/src/operators/kernel/arm/conv_add_kernel.cpp b/src/operators/kernel/arm/conv_add_kernel.cpp index 2c7aef932dc68e7a29bf60760751be0f9598cd42..64d6dfa64dc3feae5b73a17ae5b148053df34a0b 100644 --- a/src/operators/kernel/arm/conv_add_kernel.cpp +++ b/src/operators/kernel/arm/conv_add_kernel.cpp @@ -19,7 +19,7 @@ namespace paddle_mobile { namespace operators { template <> -bool ConvAddKernel::Init(const FusionConvAddParam ¶) const { +bool ConvAddKernel::Init(FusionConvAddParam *param) { return true; } diff --git a/src/operators/kernel/arm/conv_add_relu_kernel.cpp b/src/operators/kernel/arm/conv_add_relu_kernel.cpp index d3c04179b37014adc6c81f32dd6c08f697283671..356dd191e761afc5d5b6bfacd250f90ae31017b2 100644 --- a/src/operators/kernel/arm/conv_add_relu_kernel.cpp +++ b/src/operators/kernel/arm/conv_add_relu_kernel.cpp @@ -21,8 +21,7 @@ namespace paddle_mobile { namespace operators { template <> -bool ConvAddReluKernel::Init( - const FusionConvAddReluParam ¶) const { +bool ConvAddReluKernel::Init(FusionConvAddReluParam *param) { return true; } diff --git a/src/operators/kernel/arm/conv_kernel.cpp b/src/operators/kernel/arm/conv_kernel.cpp index 049425d88f96a322a0b4cb47c18d85f2df03d577..ca8aeff0dd3db5fe7b625bdeb947b2927eb619ce 100644 --- a/src/operators/kernel/arm/conv_kernel.cpp +++ b/src/operators/kernel/arm/conv_kernel.cpp @@ -21,7 +21,7 @@ namespace paddle_mobile { namespace operators { template <> -bool ConvKernel::Init(const ConvParam ¶) const { +bool ConvKernel::Init(ConvParam *param) { return true; } diff --git a/src/operators/kernel/arm/depthwise_conv_kernel.cpp b/src/operators/kernel/arm/depthwise_conv_kernel.cpp index 4cbfa23248e87e2bf3a8d97330fa19f92985a9d0..6ede0e2bef2383df8aa0593a07297f2f6233acaf 100644 --- a/src/operators/kernel/arm/depthwise_conv_kernel.cpp +++ b/src/operators/kernel/arm/depthwise_conv_kernel.cpp @@ -21,7 +21,7 @@ namespace paddle_mobile { namespace operators { template <> -bool DepthwiseConvKernel::Init(const ConvParam ¶) const { +bool DepthwiseConvKernel::Init(ConvParam *param) { return true; } diff --git a/src/operators/kernel/arm/elementwise_add_kernel.cpp b/src/operators/kernel/arm/elementwise_add_kernel.cpp index 2f5e26a37e4f2c1d370805ee7b565a60f4748b0a..bd9bb26d299bd340074965e41e5658df86bab347 100644 --- a/src/operators/kernel/arm/elementwise_add_kernel.cpp +++ b/src/operators/kernel/arm/elementwise_add_kernel.cpp @@ -27,8 +27,7 @@ struct AddFunctor { }; template <> -bool ElementwiseAddKernel::Init( - const ElementwiseAddParam ¶) const { +bool ElementwiseAddKernel::Init(ElementwiseAddParam *param) { return true; } diff --git a/src/operators/kernel/arm/fusion_fc_kernel.cpp b/src/operators/kernel/arm/fusion_fc_kernel.cpp index 5fac70e40781593669abd15b8f28ff6272f7133c..e10f11c0b19edf710ffc45f199f096bea0a34b7d 100644 --- a/src/operators/kernel/arm/fusion_fc_kernel.cpp +++ b/src/operators/kernel/arm/fusion_fc_kernel.cpp @@ -22,7 +22,7 @@ namespace paddle_mobile { namespace operators { template <> -bool FusionFcKernel::Init(const FusionFcParam ¶) const { +bool FusionFcKernel::Init(FusionFcParam *param) { return true; } diff --git a/src/operators/kernel/arm/lrn_kernel.cpp b/src/operators/kernel/arm/lrn_kernel.cpp index 839c5ee95bd4d1e9d3fd80af3df0f8a45797434e..356aa388276d9d0359b1a6b3a45c86bcb822fd9e 100644 --- a/src/operators/kernel/arm/lrn_kernel.cpp +++ b/src/operators/kernel/arm/lrn_kernel.cpp @@ -22,7 +22,7 @@ namespace paddle_mobile { namespace operators { template <> -bool LrnKernel::Init(const LrnParam ¶) const { +bool LrnKernel::Init(LrnParam *param) { return true; } diff --git a/src/operators/kernel/arm/mul_kernel.cpp b/src/operators/kernel/arm/mul_kernel.cpp index b3bb2b8075fdf306d47640c2bee3f2fc00ef0bc0..99b6576d364671be78efa9a8f2ebf85a6e133f33 100644 --- a/src/operators/kernel/arm/mul_kernel.cpp +++ b/src/operators/kernel/arm/mul_kernel.cpp @@ -22,7 +22,7 @@ namespace paddle_mobile { namespace operators { template <> -bool MulKernel::Init(const MulParam ¶) const { +bool MulKernel::Init(MulParam *param) { return true; } diff --git a/src/operators/kernel/arm/multiclass_nms_kernel.cpp b/src/operators/kernel/arm/multiclass_nms_kernel.cpp index 67cf8197ca4c3113fc4fde3d493d6ed209221b59..ecdc60f77b0cad3af2e8b026ab3666394dc43fee 100644 --- a/src/operators/kernel/arm/multiclass_nms_kernel.cpp +++ b/src/operators/kernel/arm/multiclass_nms_kernel.cpp @@ -204,8 +204,7 @@ void MultiClassOutput(const Tensor& scores, const Tensor& bboxes, } template <> -bool MultiClassNMSKernel::Init( - const MultiClassNMSParam& para) const { +bool MultiClassNMSKernel::Init(MultiClassNMSParam* param) { return true; } diff --git a/src/operators/kernel/arm/pool_kernel.cpp b/src/operators/kernel/arm/pool_kernel.cpp index 09162a13a4d0c59220cc25a02d06369c3f21ed32..5c92d5be014faf4007c0853bde08e450ebc4f79a 100644 --- a/src/operators/kernel/arm/pool_kernel.cpp +++ b/src/operators/kernel/arm/pool_kernel.cpp @@ -36,7 +36,7 @@ inline void PoolBasic(std::string pooling_type, std::vector ksize, } template <> -bool PoolKernel::Init(const PoolParam ¶) const { +bool PoolKernel::Init(PoolParam *param) { return true; } diff --git a/src/operators/kernel/arm/prior_box_kernel.cpp b/src/operators/kernel/arm/prior_box_kernel.cpp index 13939bc7bf27904405677560f17d2e0b85748310..32d3818ef244e4c2879167b4273b0538eef08c56 100644 --- a/src/operators/kernel/arm/prior_box_kernel.cpp +++ b/src/operators/kernel/arm/prior_box_kernel.cpp @@ -27,7 +27,7 @@ struct ClipFunctor { }; template <> -bool PriorBoxKernel::Init(const PriorBoxParam ¶) const { +bool PriorBoxKernel::Init(PriorBoxParam *param) { return true; } diff --git a/src/operators/kernel/arm/relu_kernel.cpp b/src/operators/kernel/arm/relu_kernel.cpp index 5bc485b77a8fac9379adbd1a3bd4d406e5a82fcb..f6480dea75289cf6615a9737acfd913a3cb13008 100644 --- a/src/operators/kernel/arm/relu_kernel.cpp +++ b/src/operators/kernel/arm/relu_kernel.cpp @@ -26,7 +26,7 @@ struct ReluFunctor { }; template <> -bool ReluKernel::Init(const ReluParam ¶) const { +bool ReluKernel::Init(ReluParam *param) { return true; } diff --git a/src/operators/kernel/arm/reshape_kernel.cpp b/src/operators/kernel/arm/reshape_kernel.cpp index 97364f9a3f7ce9fe8da5814ad2a483f858938bbf..9e0fd96d3ecd9772ef6e95bc12bb071a25a1d84a 100644 --- a/src/operators/kernel/arm/reshape_kernel.cpp +++ b/src/operators/kernel/arm/reshape_kernel.cpp @@ -20,7 +20,7 @@ namespace paddle_mobile { namespace operators { template <> -bool ReshapeKernel::Init(const ReshapeParam ¶) const { +bool ReshapeKernel::Init(ReshapeParam *param) { return true; } diff --git a/src/operators/kernel/arm/sigmoid_kernel.cpp b/src/operators/kernel/arm/sigmoid_kernel.cpp index 3e87bfacc5335e52ecdcb0b917f5826b80449ef4..5eb65cd6cebf453e46dc16c4982f81cb679bbc72 100644 --- a/src/operators/kernel/arm/sigmoid_kernel.cpp +++ b/src/operators/kernel/arm/sigmoid_kernel.cpp @@ -72,7 +72,7 @@ void sigmoid(const Tensor *X, Tensor *Y) { } template <> -bool SigmoidKernel::Init(const SigmoidParam ¶) const { +bool SigmoidKernel::Init(SigmoidParam *param) { return true; } diff --git a/src/operators/kernel/arm/softmax_kernel.cpp b/src/operators/kernel/arm/softmax_kernel.cpp index 8e966aa0af9ac84b70b154b33bad7dad9e79121d..29006d48dc00b650a725cd0a9cc3c37568e829a9 100644 --- a/src/operators/kernel/arm/softmax_kernel.cpp +++ b/src/operators/kernel/arm/softmax_kernel.cpp @@ -20,7 +20,7 @@ namespace paddle_mobile { namespace operators { template <> -bool SoftmaxKernel::Init(const SoftmaxParam ¶) const { +bool SoftmaxKernel::Init(SoftmaxParam *param) { return true; } diff --git a/src/operators/kernel/arm/transpose_kernel.cpp b/src/operators/kernel/arm/transpose_kernel.cpp index a44ff22a2f228cc357c066a01e142de7cc4f2083..f697d4ca473d64b834fe1451afd8e0df7f84b3a6 100644 --- a/src/operators/kernel/arm/transpose_kernel.cpp +++ b/src/operators/kernel/arm/transpose_kernel.cpp @@ -35,7 +35,7 @@ namespace operators { // } template <> -bool TransposeKernel::Init(const TransposeParam& para) const { +bool TransposeKernel::Init(TransposeParam* param) { return true; } diff --git a/src/operators/kernel/batchnorm_kernel.h b/src/operators/kernel/batchnorm_kernel.h index 6ef5329bc58fea8bfc17d9115b7004fed2bc4ed7..367dd0996c0df5fba7c3570285cf5e2cfd3fac99 100644 --- a/src/operators/kernel/batchnorm_kernel.h +++ b/src/operators/kernel/batchnorm_kernel.h @@ -29,7 +29,7 @@ class BatchNormKernel : public framework::OpKernelBase { public: void Compute(const BatchNormParam ¶m) const; - bool Init(const BatchNormParam ¶) const; + bool Init(BatchNormParam *param); }; } // namespace operators diff --git a/src/operators/kernel/box_coder_kernel.h b/src/operators/kernel/box_coder_kernel.h index 4c4206f52b3ffc5e60983bf1d6adb25292d01ac4..2ad63ecd90a07d955c3e239277ac1bd60f3510bb 100644 --- a/src/operators/kernel/box_coder_kernel.h +++ b/src/operators/kernel/box_coder_kernel.h @@ -30,7 +30,7 @@ class BoxCoderKernel : public framework::OpKernelBase { public: void Compute(const BoxCoderParam& param) const; - bool Init(const BoxCoderParam& para) const; + bool Init(BoxCoderParam* param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/central-arm-func/conv_add_bn_relu_func.h b/src/operators/kernel/central-arm-func/conv_add_bn_relu_func.h new file mode 100644 index 0000000000000000000000000000000000000000..6fce2c26347183c47ae756b07156de76f37ea6e5 --- /dev/null +++ b/src/operators/kernel/central-arm-func/conv_add_bn_relu_func.h @@ -0,0 +1,136 @@ +/* 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 FUSION_CONVADDBNRELU_OP + +#pragma once +#include "operators/kernel/conv_add_bn_relu_kernel.h" +#include "operators/math/depthwise_conv_3x3.h" +#include "operators/op_param.h" +namespace paddle_mobile { +namespace operators { + +template +void ConvAddBNReluCompute(const FusionConvAddBNReluParam ¶m) { + const Tensor *input = param.Input(); + Tensor filter = *param.Filter(); + Tensor bias = *param.Bias(); + Tensor new_bias = *param.NewBias(); + Tensor new_scale = *param.NewScale(); + auto new_bias_ptr = new_bias.data(); + auto new_scale_ptr = new_scale.data(); + int axis = param.Axis(); + int groups = param.Groups(); + std::vector strides = param.Strides(); + std::vector paddings = param.Paddings(); + std::vector dilations = param.Dilations(); + Tensor *output = param.Output(); + std::vector filter_shape_vec(framework::vectorize(filter.dims())); + + if (filter_shape_vec[2] == 3 && strides[0] == 1 && groups > 1) { + math::DepthwiseConvAddBNRelu3x3s1p1(input, filter, output, &bias, 1, + &new_scale, &new_bias, 1, 1); + } else { + const int batch_size = static_cast(input->dims()[0]); + + math::expand_bias(bias, axis, output->dims()); + output->ShareDataWith(bias); + + std::vector output_shape_vec(framework::vectorize(output->dims())); + size_t data_dim = filter_shape_vec.size() - 2; + std::vector col_shape_vec(1 + 2 * data_dim); + col_shape_vec[0] = input->dims()[1] / groups; + for (size_t j = 0; j < data_dim; ++j) { + col_shape_vec[j + 1] = filter_shape_vec[j + 2]; + col_shape_vec[j + 1 + data_dim] = output_shape_vec[j + 2]; + } + framework::DDim col_shape(framework::make_ddim(col_shape_vec)); + + framework::DDim col_matrix_shape = + framework::flatten_to_2d(col_shape, data_dim + 1); + + bool is_expand = + math::IsExpand(filter_shape_vec, strides, paddings, dilations); + Tensor col; + Tensor col_matrix; + if (is_expand) { + col.mutable_data(col_shape); + col_matrix.ShareDataWith(col); + col_matrix.Resize(col_matrix_shape); + } + + framework::DDim input_shape = framework::slice_ddim( + input->dims(), 1, static_cast(input->dims().size())); + + framework::DDim filter_matrix_shape = {filter.dims()[0], + filter.numel() / filter.dims()[0]}; + filter.Resize(filter_matrix_shape); + framework::DDim output_matrix_shape = { + output->dims()[1], + output->numel() / (output->dims()[0] * output->dims()[1])}; + + // convolution operator: im2col(or vol2col) + gemm + int in_step = static_cast(input->dims()[1]) / groups; + int out_step = static_cast(output->dims()[1]) / groups; + + math::Vol2ColFunctor vol2col; + math::Im2ColFunctor im2col; + + for (int i = 0; i < batch_size; i++) { + Tensor in_batch = input->Slice(i, i + 1).Resize(input_shape); + Tensor out_batch = output->Slice(i, i + 1).Resize(output_matrix_shape); + + for (int g = 0; g < groups; g++) { + Tensor in_slice = in_batch.Slice(g * in_step, (g + 1) * in_step); + + if (!is_expand) { + col.ShareDataWith(in_slice); + col_matrix.ShareDataWith(col); + col_matrix.Resize(col_matrix_shape); + } else if (data_dim == 2U) { + // im2col + im2col(in_slice, dilations, strides, + std::vector{paddings[0], paddings[1], paddings[0], + paddings[1]}, + &col); + } else if (data_dim == 3U) { + // vol2col + vol2col(in_slice, dilations, strides, paddings, &col); + } + + // gemm + Tensor out_slice = out_batch.Slice(g * out_step, (g + 1) * out_step); + Tensor filter_slice = filter.Slice(g * out_step, (g + 1) * out_step); + math::matmul(filter_slice, false, col_matrix, false, + static_cast(1), &out_slice, + static_cast(1), false); + } + } + + auto output_ptr = output->data(); + for (int c = 0; c < output_matrix_shape[0]; c++) { + int start = c * output_matrix_shape[1]; + for (int j = 0; j < output_matrix_shape[1]; j++) { + output_ptr[start + j] = + output_ptr[start + j] * new_scale_ptr[c] + new_bias_ptr[c]; + output_ptr[start + j] = + output_ptr[start + j] < 0 ? 0 : output_ptr[start + j]; + } + } + } +} +} // namespace operators +} // namespace paddle_mobile + +#endif diff --git a/src/operators/kernel/concat_kernel.h b/src/operators/kernel/concat_kernel.h index 6a7b7c6005b6e85e5b1ccfee713672b6e333b98a..adba64391e3e79569030c95e2d2681a31187f03a 100644 --- a/src/operators/kernel/concat_kernel.h +++ b/src/operators/kernel/concat_kernel.h @@ -27,7 +27,7 @@ template class ConcatKernel : public framework::OpKernelBase { public: void Compute(const ConcatParam ¶m) const; - bool Init(const ConcatParam ¶) const; + bool Init(ConcatParam *param); }; } // namespace operators diff --git a/src/operators/math/depthwiseconv3x3s1p1.h b/src/operators/kernel/conv_add_bn_relu_kernel.h similarity index 53% rename from src/operators/math/depthwiseconv3x3s1p1.h rename to src/operators/kernel/conv_add_bn_relu_kernel.h index 019237a43192f30dfb70fe85e6b16a835cba4eba..73aaf4c900393b9cbee4682fc67147d9ef0853fc 100644 --- a/src/operators/math/depthwiseconv3x3s1p1.h +++ b/src/operators/kernel/conv_add_bn_relu_kernel.h @@ -13,15 +13,33 @@ See the License for the specific language governing permissions and limitations under the License. */ #pragma once -#include "framework/tensor.h" + +#ifdef FUSION_CONVADDBNRELU_OP + +#include +#include "framework/ddim.h" +#include "framework/operator.h" +#include "operators/math/conv_func.h" +#include "operators/math/im2col.h" +#include "operators/math/math_function.h" +#include "operators/math/vol2col.h" +#include "operators/op_param.h" namespace paddle_mobile { namespace operators { -namespace math { -using framework::Tensor; -void DepthwiseConv3x3s1p1(const Tensor *input, Tensor filter, Tensor *output, - Tensor bias, bool if_bias); -} // namespace math +using framework::DDim; +using framework::OpKernelBase; + +template +class ConvAddBNReluKernel + : public OpKernelBase { + public: + void Compute(const FusionConvAddBNReluParam ¶m) const; + bool Init(FusionConvAddBNReluParam *param); +}; + } // namespace operators } // namespace paddle_mobile + +#endif diff --git a/src/operators/kernel/conv_add_kernel.h b/src/operators/kernel/conv_add_kernel.h index fb161238fee0550a42cd62cc132d6e8dbf45872f..465d8bdd8cfd71d678eb2816cae10ea6a06cec35 100644 --- a/src/operators/kernel/conv_add_kernel.h +++ b/src/operators/kernel/conv_add_kernel.h @@ -40,7 +40,7 @@ template class ConvAddKernel : public OpKernelBase { public: void Compute(const FusionConvAddParam ¶m) const; - bool Init(const FusionConvAddParam ¶) const; + bool Init(FusionConvAddParam *param); }; } // namespace operators diff --git a/src/operators/kernel/conv_add_relu_kernel.h b/src/operators/kernel/conv_add_relu_kernel.h index 9b86cd22e82e641ee6cb0a15bd25c8a1c6cbe8cb..3f36d80c4781aebea756b04e340d056a79cfd7d7 100644 --- a/src/operators/kernel/conv_add_relu_kernel.h +++ b/src/operators/kernel/conv_add_relu_kernel.h @@ -36,7 +36,7 @@ class ConvAddReluKernel : public OpKernelBase { public: void Compute(const FusionConvAddReluParam ¶m) const; - bool Init(const FusionConvAddReluParam ¶) const; + bool Init(FusionConvAddReluParam *param); }; } // namespace operators diff --git a/src/operators/kernel/conv_kernel.h b/src/operators/kernel/conv_kernel.h index 812ddd5a441f3a24c557546c1780248a557a6eb0..fedbee32a006f263fd3de25064496dad1a23177b 100644 --- a/src/operators/kernel/conv_kernel.h +++ b/src/operators/kernel/conv_kernel.h @@ -32,7 +32,7 @@ template class ConvKernel : public OpKernelBase { public: void Compute(const ConvParam ¶m) const; - bool Init(const ConvParam ¶) const; + bool Init(ConvParam *param); }; } // namespace operators diff --git a/src/operators/kernel/depthwise_conv_kernel.h b/src/operators/kernel/depthwise_conv_kernel.h index a8a8fb338620477670477703018bf9e6e9a8a604..b74a58a649bd9fa27e941e2cd5ea50b30c0218cb 100644 --- a/src/operators/kernel/depthwise_conv_kernel.h +++ b/src/operators/kernel/depthwise_conv_kernel.h @@ -31,7 +31,7 @@ template class DepthwiseConvKernel : public OpKernelBase { public: void Compute(const ConvParam ¶m) const; - bool Init(const ConvParam ¶) const; + bool Init(ConvParam *param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/elementwise_add_kernel.h b/src/operators/kernel/elementwise_add_kernel.h index fe6a0238dcd5249e822de3b5930438df808bf853..70334c1d3f788f60e974da74133823f82ab05765 100644 --- a/src/operators/kernel/elementwise_add_kernel.h +++ b/src/operators/kernel/elementwise_add_kernel.h @@ -30,7 +30,7 @@ class ElementwiseAddKernel : public framework::OpKernelBase { public: void Compute(const ElementwiseAddParam ¶m) const; - bool Init(const ElementwiseAddParam ¶) const; + bool Init(ElementwiseAddParam *param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/fpga/conv_kernel.cpp b/src/operators/kernel/fpga/conv_kernel.cpp index 30dd64fd1466902036a72faa4be5d359d2bdb0bf..dc537362a216983974bea325433c456136356fc8 100644 --- a/src/operators/kernel/fpga/conv_kernel.cpp +++ b/src/operators/kernel/fpga/conv_kernel.cpp @@ -20,7 +20,7 @@ namespace paddle_mobile { namespace operators { template <> -bool ConvKernel::Init(const ConvParam ¶) const { +bool ConvKernel::Init(ConvParam *param) { return true; } diff --git a/src/operators/kernel/fusion_fc_kernel.h b/src/operators/kernel/fusion_fc_kernel.h index c4e2b30176fb904d7fb906c5efc5137a5dcb8d59..0e31134ba5a18405a5855db1e85b3885608c4071 100644 --- a/src/operators/kernel/fusion_fc_kernel.h +++ b/src/operators/kernel/fusion_fc_kernel.h @@ -28,7 +28,7 @@ class FusionFcKernel : public framework::OpKernelBase { public: void Compute(const FusionFcParam& param) const; - bool Init(const FusionFcParam& para) const; + bool Init(FusionFcParam* param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/lrn_kernel.h b/src/operators/kernel/lrn_kernel.h index 40c48b3663c6825e03028439725c428ce048d254..7327451a0aa21b7bcf9ae111f63c19f2b6bb2d3a 100644 --- a/src/operators/kernel/lrn_kernel.h +++ b/src/operators/kernel/lrn_kernel.h @@ -170,7 +170,7 @@ template class LrnKernel : public framework::OpKernelBase { public: void Compute(const LrnParam ¶m) const; - bool Init(const LrnParam ¶) const; + bool Init(LrnParam *param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/mali/batchnorm_kernel.cpp b/src/operators/kernel/mali/batchnorm_kernel.cpp index ff27afc71c42ed1c2b7e67eefbdadd86e92cc0fc..22ce472c464bc9ed89ee721244e9873c01601ebd 100644 --- a/src/operators/kernel/mali/batchnorm_kernel.cpp +++ b/src/operators/kernel/mali/batchnorm_kernel.cpp @@ -128,7 +128,7 @@ class AclBatchNormOp : public acl::ACLOperator { }; template <> -bool BatchNormKernel::Init(const BatchNormParam& param) const { +bool BatchNormKernel::Init(BatchNormParam* param) { AclBatchNormOp* acl_op = reinterpret_cast*>(this->GetAclOp()); if (acl_op == nullptr) { diff --git a/src/operators/kernel/mali/conv_kernel.cpp b/src/operators/kernel/mali/conv_kernel.cpp index f3212cae970b2a554412f59cf48a6e5156463969..36f438605317dd016d2f44cf9c5efc0ab33c5923 100644 --- a/src/operators/kernel/mali/conv_kernel.cpp +++ b/src/operators/kernel/mali/conv_kernel.cpp @@ -195,7 +195,7 @@ class AclConvOp : public acl::ACLOperator { }; template <> -bool ConvKernel::Init(const ConvParam& param) const { +bool ConvKernel::Init(ConvParam* param) { AclConvOp* acl_op = reinterpret_cast*>(this->GetAclOp()); if (acl_op == nullptr) { diff --git a/src/operators/kernel/mali/elementwise_add_kernel.cpp b/src/operators/kernel/mali/elementwise_add_kernel.cpp index 43d33b3fd2b2cc747ae8c943437e675c84a4cdc6..9748bbbb5454f10ad9ea83e37d599fb1c6cdb53e 100644 --- a/src/operators/kernel/mali/elementwise_add_kernel.cpp +++ b/src/operators/kernel/mali/elementwise_add_kernel.cpp @@ -27,8 +27,7 @@ struct AddFunctor { }; template <> -bool ElementwiseAddKernel::Init( - const ElementwiseAddParam ¶) const { +bool ElementwiseAddKernel::Init(ElementwiseAddParam *param) { return true; } diff --git a/src/operators/kernel/mali/fushion_fc_kernel.cpp b/src/operators/kernel/mali/fushion_fc_kernel.cpp index 64ab07a9b955893c01e2684cba0a14fa25d032ed..a76c3c46012a758a05cf8f846a15376ad1b9f33c 100644 --- a/src/operators/kernel/mali/fushion_fc_kernel.cpp +++ b/src/operators/kernel/mali/fushion_fc_kernel.cpp @@ -22,7 +22,7 @@ namespace paddle_mobile { namespace operators { template <> -bool FusionFcKernel::Init(const FusionFcParam ¶) const { +bool FusionFcKernel::Init(FusionFcParam *param) { return true; } diff --git a/src/operators/kernel/mali/mul_kernel.cpp b/src/operators/kernel/mali/mul_kernel.cpp index f2a84deaa1de999e94e335de6d4f40981bded5a8..3a9ec4ebb319d9e521240ad987a49549c22c1ff2 100644 --- a/src/operators/kernel/mali/mul_kernel.cpp +++ b/src/operators/kernel/mali/mul_kernel.cpp @@ -22,7 +22,7 @@ namespace paddle_mobile { namespace operators { template <> -bool MulKernel::Init(const MulParam ¶) const { +bool MulKernel::Init(MulParam *param) { return true; } diff --git a/src/operators/kernel/mali/reshape_kernel.cpp b/src/operators/kernel/mali/reshape_kernel.cpp index d7521454d46dfc82064930971d2b996b542af54a..57837a677033590e92a307bd69a77c076c5ba805 100644 --- a/src/operators/kernel/mali/reshape_kernel.cpp +++ b/src/operators/kernel/mali/reshape_kernel.cpp @@ -22,7 +22,7 @@ namespace paddle_mobile { namespace operators { template <> -bool ReshapeKernel::Init(const ReshapeParam ¶) const { +bool ReshapeKernel::Init(ReshapeParam *param) { return true; } diff --git a/src/operators/kernel/mul_kernel.h b/src/operators/kernel/mul_kernel.h index 81db202c2d26fae9abb971a2cafe32f9b20dfe22..f7dcb738b38448fe38eb60dcbbd4a2abda7a858a 100644 --- a/src/operators/kernel/mul_kernel.h +++ b/src/operators/kernel/mul_kernel.h @@ -29,7 +29,7 @@ template class MulKernel : public framework::OpKernelBase { public: void Compute(const MulParam ¶m) const; - bool Init(const MulParam ¶) const; + bool Init(MulParam *param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/multiclass_nms_kernel.h b/src/operators/kernel/multiclass_nms_kernel.h index ca86604f2c6e550c219e54b6533c1500fb2912c4..9bd00b874a1140373decca582f793febf0e941ec 100644 --- a/src/operators/kernel/multiclass_nms_kernel.h +++ b/src/operators/kernel/multiclass_nms_kernel.h @@ -28,7 +28,7 @@ class MultiClassNMSKernel : public framework::OpKernelBase { public: void Compute(const MultiClassNMSParam& param) const; - bool Init(const MultiClassNMSParam& para) const; + bool Init(MultiClassNMSParam* param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/pool_kernel.h b/src/operators/kernel/pool_kernel.h index 3285f56cc01fad554bff7e6a4d25769f8ef56d24..d666910b73e7a3cef2cc59d4ba32b826ae6d0876 100644 --- a/src/operators/kernel/pool_kernel.h +++ b/src/operators/kernel/pool_kernel.h @@ -28,7 +28,7 @@ template class PoolKernel : public OpKernelBase { public: void Compute(const PoolParam ¶m) const override; - bool Init(const PoolParam ¶) const; + bool Init(PoolParam *param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/prior_box_kernel.h b/src/operators/kernel/prior_box_kernel.h index 79fc630b8efb50dec1ff336d2b66d5094eaeb5a5..d169a01d7f45f7dbdcc02be0e1e71690b8550af8 100644 --- a/src/operators/kernel/prior_box_kernel.h +++ b/src/operators/kernel/prior_box_kernel.h @@ -55,7 +55,7 @@ class PriorBoxKernel : public framework::OpKernelBase { public: void Compute(const PriorBoxParam& param) const; - bool Init(const PriorBoxParam& para) const; + bool Init(PriorBoxParam* param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/relu_kernel.h b/src/operators/kernel/relu_kernel.h index 2155c33811f553435e4a89b5b23533e2bd42db5d..64016656b20b0fdb08f1342f7853e2e727a6bb81 100644 --- a/src/operators/kernel/relu_kernel.h +++ b/src/operators/kernel/relu_kernel.h @@ -27,7 +27,7 @@ template class ReluKernel : public framework::OpKernelBase { public: void Compute(const ReluParam& param) const; - bool Init(const ReluParam& para) const; + bool Init(ReluParam* param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/reshape_kernel.h b/src/operators/kernel/reshape_kernel.h index 364f5b0902c2661017f2e72520849836f64dd0bb..47eba531b9f36d83d44588d9cdfb162519c24180 100644 --- a/src/operators/kernel/reshape_kernel.h +++ b/src/operators/kernel/reshape_kernel.h @@ -71,7 +71,7 @@ template class ReshapeKernel : public framework::OpKernelBase { public: void Compute(const ReshapeParam& param) const; - bool Init(const ReshapeParam& para) const; + bool Init(ReshapeParam* param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/sigmoid_kernel.h b/src/operators/kernel/sigmoid_kernel.h index e9eaae5ad867c6880db7346f9632ff37a92aaf66..fc3eb5e1bf158c541b2f00d9e57ddd4699344006 100644 --- a/src/operators/kernel/sigmoid_kernel.h +++ b/src/operators/kernel/sigmoid_kernel.h @@ -26,7 +26,7 @@ template class SigmoidKernel : public OpKernelBase { public: void Compute(const SigmoidParam& param) const override; - bool Init(const SigmoidParam& para) const; + bool Init(SigmoidParam* param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/softmax_kernel.h b/src/operators/kernel/softmax_kernel.h index a7a7666e32ef1923a47d71d94c93e813a23028c5..5a87d64dd9987d445b13a4fa9dc29a04e4ecc398 100644 --- a/src/operators/kernel/softmax_kernel.h +++ b/src/operators/kernel/softmax_kernel.h @@ -29,7 +29,7 @@ template class SoftmaxKernel : public OpKernelBase { public: void Compute(const SoftmaxParam ¶m) const override; - bool Init(const SoftmaxParam ¶) const; + bool Init(SoftmaxParam *param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/kernel/transpose_kernel.h b/src/operators/kernel/transpose_kernel.h index 6526d97df9863392f783841a784cb5df4e45f218..f1a21ebbb28c2acdb905ce9f09c28f0d47e17294 100644 --- a/src/operators/kernel/transpose_kernel.h +++ b/src/operators/kernel/transpose_kernel.h @@ -29,7 +29,7 @@ class TransposeKernel : public framework::OpKernelBase { public: void Compute(const TransposeParam& param) const; - bool Init(const TransposeParam& para) const; + bool Init(TransposeParam* param); }; } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/math/depthwise_conv_3x3.cpp b/src/operators/math/depthwise_conv_3x3.cpp index 9c37cdea8fae1b5ec139cefbec82511ce948bff5..f74e365c7e087551e55363566d3dbd6ba530bfea 100644 --- a/src/operators/math/depthwise_conv_3x3.cpp +++ b/src/operators/math/depthwise_conv_3x3.cpp @@ -12,6 +12,7 @@ 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 "operators/math/depthwise_conv_3x3.h" +#include #include namespace paddle_mobile { @@ -501,6 +502,322 @@ void DepthwiseConv3x3s1p1(const Tensor *input, const Tensor *filter, } } } +void DepthwiseConvAddBNRelu3x3s1p1(const Tensor *input, Tensor filter, + Tensor *output, Tensor *bias, bool if_bias, + Tensor *new_scale, Tensor *new_bias, + bool if_bn, bool if_relu) { + const float *input_data = input->data(); + const float *filter_data = filter.data(); + float *output_data = output->data(); + const float *bias_data = bias->data(); + const float *newscale_data = new_scale->data(); + const float *newbias_data = new_bias->data(); + + const int h = static_cast(input->dims()[2]); + const int w = static_cast(input->dims()[3]); + const int l = h; + + const int batch_size = static_cast(input->dims()[0]); + const int c = static_cast(input->dims()[1]); + const int hxw = h * w; + float32x4_t vbias = vdupq_n_f32(0.0); + float32x4_t vnewbias = vdupq_n_f32(0.0); + float32x4_t vnewscale = vdupq_n_f32(1.0); + float32x4_t vzero = vdupq_n_f32(0); + + for (int b = 0; b < batch_size; ++b) { + const float *filter_data_tmp = filter_data; + + for (int j = 0; j < c; ++j) { + if (if_bias) { + vbias = vdupq_n_f32(bias_data[j]); + } + if (if_bn) { + vnewbias = vdupq_n_f32(newbias_data[j]); + vnewscale = vdupq_n_f32(newscale_data[j]); + } + int l_mid = l - 2; // l=1->l_mid=-1,l=2->l_mid=0 + float w00 = filter_data_tmp[0]; + float w01 = filter_data_tmp[1]; + float w02 = filter_data_tmp[2]; + float w10 = filter_data_tmp[3]; + float w11 = filter_data_tmp[4]; + float w12 = filter_data_tmp[5]; + float w20 = filter_data_tmp[6]; + float w21 = filter_data_tmp[7]; + float w22 = filter_data_tmp[8]; + + output_data[0] = + (w11 * input_data[0] + w12 * input_data[1] + w21 * input_data[l] + + w22 * input_data[l + 1] + bias_data[j]) * + newscale_data[j] + + newbias_data[j]; + output_data[l - 1] = (w10 * input_data[l - 2] + w11 * input_data[l - 1] + + w20 * input_data[2 * l - 2] + + w21 * input_data[2 * l - 1] + bias_data[j]) * + newscale_data[j] + + newbias_data[j]; + + output_data[(l - 1) * l] = + (w01 * input_data[(l - 2) * l] + w02 * input_data[(l - 2) * l + 1] + + w11 * input_data[(l - 1) * l] + w12 * input_data[(l - 1) * l + 1] + + bias_data[j]) * + newscale_data[j] + + newbias_data[j]; + output_data[l * l - 1] = (w00 * input_data[(l - 2) * (l + 1)] + + w01 * input_data[(l - 2) * (l + 1) + 1] + + w10 * input_data[l * l - 2] + + w11 * input_data[l * l - 1] + bias_data[j]) * + newscale_data[j] + + newbias_data[j]; + if (if_relu) { + output_data[0] = output_data[0] < 0 ? 0 : output_data[0]; + output_data[l - 1] = output_data[l - 1] < 0 ? 0 : output_data[l - 1]; + output_data[(l - 1) * l] = + output_data[(l - 1) * l] < 0 ? 0 : output_data[(l - 1) * l]; + output_data[l * l - 1] = + output_data[l * l - 1] < 0 ? 0 : output_data[l * l - 1]; + } + for (int i = 1; i < l - 1; ++i) { + output_data[i * l] = + (w01 * input_data[i * l - l] + w02 * input_data[i * l - l + 1] + + w11 * input_data[i * l] + w12 * input_data[i * l + 1] + + w21 * input_data[i * l + l] + w22 * input_data[i * l + l + 1] + + bias_data[j]) * + newscale_data[j] + + newbias_data[j]; + output_data[i * l + l - 1] = + (w00 * input_data[i * l + l - 1 - l - 1] + + w01 * input_data[i * l + l - 1 - l] + + w10 * input_data[i * l + l - 1 - 1] + + w11 * input_data[i * l + l - 1] + + w20 * input_data[i * l + l - 1 + l - 1] + + w21 * input_data[i * l + l - 1 + l] + bias_data[j]) * + newscale_data[j] + + newbias_data[j]; + if (if_relu) { + output_data[i * l] = output_data[i * l] < 0 ? 0 : output_data[i * l]; + output_data[i * l + l - 1] = + output_data[i * l + l - 1] < 0 ? 0 : output_data[i * l + l - 1]; + } + } + + // top 1 row and bottom 1 row + const float *input_tmp = input_data; + + float32x4_t in0, in1, in2, in3, in4, in5, in6, in7, tmp0, tmp1, tmp2, + tmp3, tmp4, tmp5, out0; + in0 = vld1q_f32(input_tmp); + in2 = vld1q_f32(input_tmp + l); + const float *input_tmp_end = input_tmp + (l - 2) * l; + in4 = vld1q_f32(input_tmp_end); + in6 = vld1q_f32(input_tmp_end + l); + int c_mid = l_mid; + auto output_ptr = output_data + 1; + for (; c_mid > 3; c_mid -= 4) { + in1 = vld1q_f32(input_tmp + 4); + in3 = vld1q_f32(input_tmp + l + 4); + + tmp0 = vextq_f32(in0, in1, 1); + tmp1 = vextq_f32(in0, in1, 2); + + tmp2 = vextq_f32(in2, in3, 1); + tmp3 = vextq_f32(in2, in3, 2); + + out0 = vmulq_n_f32(in0, w10); + out0 = vmlaq_n_f32(out0, tmp0, w11); + out0 = vmlaq_n_f32(out0, tmp1, w12); + out0 = vmlaq_n_f32(out0, in2, w20); + out0 = vmlaq_n_f32(out0, tmp2, w21); + out0 = vmlaq_n_f32(out0, tmp3, w22); + out0 = vaddq_f32(out0, vbias); + out0 = vmlaq_f32(vnewbias, vnewscale, out0); + if (if_relu) { + out0 = vmaxq_f32(out0, vzero); + } + vst1q_f32(output_ptr, out0); + + in5 = vld1q_f32(input_tmp_end + 4); + in7 = vld1q_f32(input_tmp_end + l + 4); + + tmp0 = vextq_f32(in4, in5, 1); + tmp1 = vextq_f32(in4, in5, 2); + tmp2 = vextq_f32(in6, in7, 1); + tmp3 = vextq_f32(in6, in7, 2); + + out0 = vmulq_n_f32(in4, w00); + out0 = vmlaq_n_f32(out0, tmp0, w01); + out0 = vmlaq_n_f32(out0, tmp1, w02); + out0 = vmlaq_n_f32(out0, in6, w10); + out0 = vmlaq_n_f32(out0, tmp2, w11); + out0 = vmlaq_n_f32(out0, tmp3, w12); + out0 = vaddq_f32(out0, vbias); + out0 = vmlaq_f32(vnewbias, vnewscale, out0); + if (if_relu) { + out0 = vmaxq_f32(out0, vzero); + } + vst1q_f32(output_ptr + (l - 1) * l, out0); + + // can optimize to each 8 stride. + input_tmp += 4; + input_tmp_end += 4; + output_ptr += 4; + in0 = in1; + in2 = in3; + in4 = in5; + in6 = in7; + } + + // top right pad + float32x4_t pad0 = vdupq_n_f32(input_data[l - 1]); + float32x4_t pad1 = vdupq_n_f32(input_data[2 * l - 1]); + + tmp0 = vextq_f32(in0, pad0, 1); + tmp1 = vextq_f32(in0, pad0, 2); + tmp2 = vextq_f32(in2, pad1, 1); + tmp3 = vextq_f32(in2, pad1, 2); + + out0 = vmulq_n_f32(in0, w10); + out0 = vmlaq_n_f32(out0, tmp0, w11); + out0 = vmlaq_n_f32(out0, tmp1, w12); + out0 = vmlaq_n_f32(out0, in2, w20); + out0 = vmlaq_n_f32(out0, tmp2, w21); + out0 = vmlaq_n_f32(out0, tmp3, w22); + out0 = vaddq_f32(out0, vbias); + out0 = vmlaq_f32(vnewbias, vnewscale, out0); + if (if_relu) { + out0 = vmaxq_f32(out0, vzero); + } + for (int i = 0; i < c_mid; ++i) { + if (i == 0) { + vst1q_lane_f32(output_ptr + i, out0, 0); + } + if (i == 1) { + vst1q_lane_f32(output_ptr + i, out0, 1); + } + if (i == 2) { + vst1q_lane_f32(output_ptr + i, out0, 2); + } + } + + // bottom right pad + float32x4_t pad2 = vdupq_n_f32(input_data[l * l - 1 - l]); + float32x4_t pad3 = vdupq_n_f32(input_data[l * l - 1]); + + tmp0 = vextq_f32(in4, pad2, 1); + tmp1 = vextq_f32(in4, pad2, 2); + tmp2 = vextq_f32(in6, pad3, 1); + tmp3 = vextq_f32(in6, pad3, 2); + + out0 = vmulq_n_f32(in4, w00); + out0 = vmlaq_n_f32(out0, tmp0, w01); + out0 = vmlaq_n_f32(out0, tmp1, w02); + out0 = vmlaq_n_f32(out0, in6, w10); + out0 = vmlaq_n_f32(out0, tmp2, w11); + out0 = vmlaq_n_f32(out0, tmp3, w12); + out0 = vaddq_f32(out0, vbias); + out0 = vmlaq_f32(vnewbias, vnewscale, out0); + if (if_relu) { + out0 = vmaxq_f32(out0, vzero); + } + for (int i = 0; i < c_mid; ++i) { + if (i == 0) { + vst1q_lane_f32(output_ptr + (l - 1) * l + i, out0, 0); + } + if (i == 1) { + vst1q_lane_f32(output_ptr + (l - 1) * l + i, out0, 1); + } + if (i == 2) { + vst1q_lane_f32(output_ptr + (l - 1) * l + i, out0, 2); + } + } + // mid + + for (int i = 0; i < l - 2; ++i) { + auto output_ptr = output_data + (i + 1) * l + 1; + input_tmp = input_data + i * l; + auto in0_tmp = vld1q_f32(input_tmp); + auto in2_tmp = vld1q_f32(input_tmp + l); + auto in4_tmp = vld1q_f32(input_tmp + l + l); + c_mid = l_mid; + for (; c_mid > 3; c_mid -= 4) { + auto in1_tmp = vld1q_f32(input_tmp + 4); + auto in3_tmp = vld1q_f32(input_tmp + l + 4); + auto in5_tmp = vld1q_f32(input_tmp + l + l + 4); + + tmp0 = vextq_f32(in0_tmp, in1_tmp, 1); + tmp1 = vextq_f32(in0_tmp, in1_tmp, 2); + tmp2 = vextq_f32(in2_tmp, in3_tmp, 1); + tmp3 = vextq_f32(in2_tmp, in3_tmp, 2); + tmp4 = vextq_f32(in4_tmp, in5_tmp, 1); + tmp5 = vextq_f32(in4_tmp, in5_tmp, 2); + + out0 = vmulq_n_f32(in0_tmp, w00); + out0 = vmlaq_n_f32(out0, tmp0, w01); + out0 = vmlaq_n_f32(out0, tmp1, w02); + out0 = vmlaq_n_f32(out0, in2_tmp, w10); + out0 = vmlaq_n_f32(out0, tmp2, w11); + out0 = vmlaq_n_f32(out0, tmp3, w12); + out0 = vmlaq_n_f32(out0, in4_tmp, w20); + out0 = vmlaq_n_f32(out0, tmp4, w21); + out0 = vmlaq_n_f32(out0, tmp5, w22); + out0 = vaddq_f32(out0, vbias); + out0 = vmlaq_f32(vnewbias, vnewscale, out0); + if (if_relu) { + out0 = vmaxq_f32(out0, vzero); + } + vst1q_f32(output_ptr, out0); + + output_ptr += 4; + input_tmp += 4; + in0_tmp = in1_tmp; + in2_tmp = in3_tmp; + in4_tmp = in5_tmp; + } + + float32x4_t pad0 = vdupq_n_f32(input_data[i * l + l - 1]); + float32x4_t pad1 = vdupq_n_f32(input_data[i * l + l - 1 + l]); + float32x4_t pad2 = vdupq_n_f32(input_data[i * l + l - 1 + l + l]); + + tmp0 = vextq_f32(in0_tmp, pad0, 1); + tmp1 = vextq_f32(in0_tmp, pad0, 2); + tmp2 = vextq_f32(in2_tmp, pad1, 1); + tmp3 = vextq_f32(in2_tmp, pad1, 2); + tmp4 = vextq_f32(in4_tmp, pad2, 1); + tmp5 = vextq_f32(in4_tmp, pad2, 2); + + out0 = vmulq_n_f32(in0_tmp, w00); + out0 = vmlaq_n_f32(out0, tmp0, w01); + out0 = vmlaq_n_f32(out0, tmp1, w02); + out0 = vmlaq_n_f32(out0, in2_tmp, w10); + out0 = vmlaq_n_f32(out0, tmp2, w11); + out0 = vmlaq_n_f32(out0, tmp3, w12); + out0 = vmlaq_n_f32(out0, in4_tmp, w20); + out0 = vmlaq_n_f32(out0, tmp4, w21); + out0 = vmlaq_n_f32(out0, tmp5, w22); + out0 = vaddq_f32(out0, vbias); + out0 = vmlaq_f32(vnewbias, vnewscale, out0); + if (if_relu) { + out0 = vmaxq_f32(out0, vzero); + } + for (int i = 0; i < c_mid; ++i) { + if (i == 0) { + vst1q_lane_f32(output_ptr + i, out0, 0); + } + if (i == 1) { + vst1q_lane_f32(output_ptr + i, out0, 1); + } + if (i == 2) { + vst1q_lane_f32(output_ptr + i, out0, 2); + } + } + } + output_data += hxw; + input_data += hxw; + filter_data_tmp += 9; + } + } +} } // namespace math } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/math/depthwise_conv_3x3.h b/src/operators/math/depthwise_conv_3x3.h index ab2a04369e1fc6e984ffa6f8f5667dd2a10e2a55..44299295eebad6a90fd994cf74589c09a3573aee 100644 --- a/src/operators/math/depthwise_conv_3x3.h +++ b/src/operators/math/depthwise_conv_3x3.h @@ -32,6 +32,10 @@ void DepthwiseConv3x3(const Tensor *input, vector strides, Tensor *output, bool if_bias); void DepthwiseConv3x3s1p1(const Tensor *input, const Tensor *filter, Tensor *output, Tensor *bias, bool if_bias); +void DepthwiseConvAddBNRelu3x3s1p1(const Tensor *input, Tensor filter, + Tensor *output, Tensor *bias, bool if_bias, + Tensor *new_scale, Tensor *new_bias, + bool if_bn, bool if_relu); } // namespace math } // namespace operators } // namespace paddle_mobile diff --git a/src/operators/math/depthwiseconv3x3s1p1.cpp b/src/operators/math/depthwiseconv3x3s1p1.cpp deleted file mode 100644 index 88cac515201c114e83cb9e85b39a51fb3f8e7955..0000000000000000000000000000000000000000 --- a/src/operators/math/depthwiseconv3x3s1p1.cpp +++ /dev/null @@ -1,288 +0,0 @@ -/* 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 "operators/math/depthwiseconv3x3s1p1.h" -#include - -namespace paddle_mobile { -namespace operators { -namespace math { - -using framework::Tensor; - -void DepthwiseConv3x3s1p1(const Tensor *input, Tensor filter, Tensor *output, - Tensor bias, bool if_bias) { - const float *input_data = input->data(); - const float *filter_data = filter.data(); - float *output_data = output->data(); - const float *bias_data = bias.data(); - - const int h = static_cast(input->dims()[2]); - const int w = static_cast(input->dims()[3]); - const int l = h; - - const int batch_size = static_cast(input->dims()[0]); - const int c = static_cast(input->dims()[1]); - const int hxw = h * w; - float32x4_t vbias = vdupq_n_f32(0.0); - for (int b = 0; b < batch_size; ++b) { - const float *filter_data_tmp = filter_data; - - for (int j = 0; j < c; ++j) { - if (if_bias) { - vbias = vdupq_n_f32(bias_data[j]); - } - - int l_mid = l - 2; // l=1->l_mid=-1,l=2->l_mid=0 - float w00 = filter_data_tmp[0]; - float w01 = filter_data_tmp[1]; - float w02 = filter_data_tmp[2]; - float w10 = filter_data_tmp[3]; - float w11 = filter_data_tmp[4]; - float w12 = filter_data_tmp[5]; - float w20 = filter_data_tmp[6]; - float w21 = filter_data_tmp[7]; - float w22 = filter_data_tmp[8]; - - output_data[0] = w11 * input_data[0] + w12 * input_data[1] + - w21 * input_data[l] + w22 * input_data[l + 1] + - bias_data[j]; - output_data[l - 1] = w10 * input_data[l - 2] + w11 * input_data[l - 1] + - w20 * input_data[2 * l - 2] + - w21 * input_data[2 * l - 1] + bias_data[j]; - output_data[(l - 1) * l] = - w01 * input_data[(l - 2) * l] + w02 * input_data[(l - 2) * l + 1] + - w11 * input_data[(l - 1) * l] + w12 * input_data[(l - 1) * l + 1] + - bias_data[j]; - output_data[l * l - 1] = w00 * input_data[(l - 2) * (l + 1)] + - w01 * input_data[(l - 2) * (l + 1) + 1] + - w10 * input_data[l * l - 2] + - w11 * input_data[l * l - 1] + bias_data[j]; - - for (int i = 1; i < l - 1; ++i) { - output_data[i * l] = - w01 * input_data[i * l - l] + w02 * input_data[i * l - l + 1] + - w11 * input_data[i * l] + w12 * input_data[i * l + 1] + - w21 * input_data[i * l + l] + w22 * input_data[i * l + l + 1] + - bias_data[j]; - output_data[i * l + l - 1] = w00 * input_data[i * l + l - 1 - l - 1] + - w01 * input_data[i * l + l - 1 - l] + - w10 * input_data[i * l + l - 1 - 1] + - w11 * input_data[i * l + l - 1] + - w20 * input_data[i * l + l - 1 + l - 1] + - w21 * input_data[i * l + l - 1 + l] + - bias_data[j]; - } - - // top 1 row and bottom 1 row - const float *input_tmp = input_data; - - float32x4_t in0, in1, in2, in3, in4, in5, in6, in7, tmp0, tmp1, tmp2, - tmp3, tmp4, tmp5, out0; - in0 = vld1q_f32(input_tmp); - in2 = vld1q_f32(input_tmp + l); - const float *input_tmp_end = input_tmp + (l - 2) * l; - in4 = vld1q_f32(input_tmp_end); - in6 = vld1q_f32(input_tmp_end + l); - int c_mid = l_mid; - auto output_ptr = output_data + 1; - for (; c_mid > 3; c_mid -= 4) { - in1 = vld1q_f32(input_tmp + 4); - in3 = vld1q_f32(input_tmp + l + 4); - - tmp0 = vextq_f32(in0, in1, 1); - tmp1 = vextq_f32(in0, in1, 2); - - tmp2 = vextq_f32(in2, in3, 1); - tmp3 = vextq_f32(in2, in3, 2); - - out0 = vmulq_n_f32(in0, w10); - out0 = vmlaq_n_f32(out0, tmp0, w11); - out0 = vmlaq_n_f32(out0, tmp1, w12); - out0 = vmlaq_n_f32(out0, in2, w20); - out0 = vmlaq_n_f32(out0, tmp2, w21); - out0 = vmlaq_n_f32(out0, tmp3, w22); - out0 = vaddq_f32(out0, vbias); - - vst1q_f32(output_ptr, out0); - - in5 = vld1q_f32(input_tmp_end + 4); - in7 = vld1q_f32(input_tmp_end + l + 4); - - tmp0 = vextq_f32(in4, in5, 1); - tmp1 = vextq_f32(in4, in5, 2); - tmp2 = vextq_f32(in6, in7, 1); - tmp3 = vextq_f32(in6, in7, 2); - - out0 = vmulq_n_f32(in4, w00); - out0 = vmlaq_n_f32(out0, tmp0, w01); - out0 = vmlaq_n_f32(out0, tmp1, w02); - out0 = vmlaq_n_f32(out0, in6, w10); - out0 = vmlaq_n_f32(out0, tmp2, w11); - out0 = vmlaq_n_f32(out0, tmp3, w12); - out0 = vaddq_f32(out0, vbias); - - vst1q_f32(output_ptr + (l - 1) * l, out0); - - // can optimize to each 8 stride. - input_tmp += 4; - input_tmp_end += 4; - output_ptr += 4; - in0 = in1; - in2 = in3; - in4 = in5; - in6 = in7; - } - - // top right pad - float32x4_t pad0 = vdupq_n_f32(input_data[l - 1]); - float32x4_t pad1 = vdupq_n_f32(input_data[2 * l - 1]); - - tmp0 = vextq_f32(in0, pad0, 1); - tmp1 = vextq_f32(in0, pad0, 2); - tmp2 = vextq_f32(in2, pad1, 1); - tmp3 = vextq_f32(in2, pad1, 2); - - out0 = vmulq_n_f32(in0, w10); - out0 = vmlaq_n_f32(out0, tmp0, w11); - out0 = vmlaq_n_f32(out0, tmp1, w12); - out0 = vmlaq_n_f32(out0, in2, w20); - out0 = vmlaq_n_f32(out0, tmp2, w21); - out0 = vmlaq_n_f32(out0, tmp3, w22); - out0 = vaddq_f32(out0, vbias); - - for (int i = 0; i < c_mid; ++i) { - if (i == 0) { - vst1q_lane_f32(output_ptr + i, out0, 0); - } - if (i == 1) { - vst1q_lane_f32(output_ptr + i, out0, 1); - } - if (i == 2) { - vst1q_lane_f32(output_ptr + i, out0, 2); - } - } - - // bottom right pad - float32x4_t pad2 = vdupq_n_f32(input_data[l * l - 1 - l]); - float32x4_t pad3 = vdupq_n_f32(input_data[l * l - 1]); - - tmp0 = vextq_f32(in4, pad2, 1); - tmp1 = vextq_f32(in4, pad2, 2); - tmp2 = vextq_f32(in6, pad3, 1); - tmp3 = vextq_f32(in6, pad3, 2); - - out0 = vmulq_n_f32(in4, w00); - out0 = vmlaq_n_f32(out0, tmp0, w01); - out0 = vmlaq_n_f32(out0, tmp1, w02); - out0 = vmlaq_n_f32(out0, in6, w10); - out0 = vmlaq_n_f32(out0, tmp2, w11); - out0 = vmlaq_n_f32(out0, tmp3, w12); - out0 = vaddq_f32(out0, vbias); - - for (int i = 0; i < c_mid; ++i) { - if (i == 0) { - vst1q_lane_f32(output_ptr + (l - 1) * l + i, out0, 0); - } - if (i == 1) { - vst1q_lane_f32(output_ptr + (l - 1) * l + i, out0, 1); - } - if (i == 2) { - vst1q_lane_f32(output_ptr + (l - 1) * l + i, out0, 2); - } - } - // mid - - for (int i = 0; i < l - 2; ++i) { - auto output_ptr = output_data + (i + 1) * l + 1; - input_tmp = input_data + i * l; - auto in0_tmp = vld1q_f32(input_tmp); - auto in2_tmp = vld1q_f32(input_tmp + l); - auto in4_tmp = vld1q_f32(input_tmp + l + l); - c_mid = l_mid; - for (; c_mid > 3; c_mid -= 4) { - auto in1_tmp = vld1q_f32(input_tmp + 4); - auto in3_tmp = vld1q_f32(input_tmp + l + 4); - auto in5_tmp = vld1q_f32(input_tmp + l + l + 4); - - tmp0 = vextq_f32(in0_tmp, in1_tmp, 1); - tmp1 = vextq_f32(in0_tmp, in1_tmp, 2); - tmp2 = vextq_f32(in2_tmp, in3_tmp, 1); - tmp3 = vextq_f32(in2_tmp, in3_tmp, 2); - tmp4 = vextq_f32(in4_tmp, in5_tmp, 1); - tmp5 = vextq_f32(in4_tmp, in5_tmp, 2); - - out0 = vmulq_n_f32(in0_tmp, w00); - out0 = vmlaq_n_f32(out0, tmp0, w01); - out0 = vmlaq_n_f32(out0, tmp1, w02); - out0 = vmlaq_n_f32(out0, in2_tmp, w10); - out0 = vmlaq_n_f32(out0, tmp2, w11); - out0 = vmlaq_n_f32(out0, tmp3, w12); - out0 = vmlaq_n_f32(out0, in4_tmp, w20); - out0 = vmlaq_n_f32(out0, tmp4, w21); - out0 = vmlaq_n_f32(out0, tmp5, w22); - out0 = vaddq_f32(out0, vbias); - - vst1q_f32(output_ptr, out0); - - output_ptr += 4; - input_tmp += 4; - in0_tmp = in1_tmp; - in2_tmp = in3_tmp; - in4_tmp = in5_tmp; - } - - float32x4_t pad0 = vdupq_n_f32(input_data[i * l + l - 1]); - float32x4_t pad1 = vdupq_n_f32(input_data[i * l + l - 1 + l]); - float32x4_t pad2 = vdupq_n_f32(input_data[i * l + l - 1 + l + l]); - - tmp0 = vextq_f32(in0_tmp, pad0, 1); - tmp1 = vextq_f32(in0_tmp, pad0, 2); - tmp2 = vextq_f32(in2_tmp, pad1, 1); - tmp3 = vextq_f32(in2_tmp, pad1, 2); - tmp4 = vextq_f32(in4_tmp, pad2, 1); - tmp5 = vextq_f32(in4_tmp, pad2, 2); - - out0 = vmulq_n_f32(in0_tmp, w00); - out0 = vmlaq_n_f32(out0, tmp0, w01); - out0 = vmlaq_n_f32(out0, tmp1, w02); - out0 = vmlaq_n_f32(out0, in2_tmp, w10); - out0 = vmlaq_n_f32(out0, tmp2, w11); - out0 = vmlaq_n_f32(out0, tmp3, w12); - out0 = vmlaq_n_f32(out0, in4_tmp, w20); - out0 = vmlaq_n_f32(out0, tmp4, w21); - out0 = vmlaq_n_f32(out0, tmp5, w22); - out0 = vaddq_f32(out0, vbias); - - for (int i = 0; i < c_mid; ++i) { - if (i == 0) { - vst1q_lane_f32(output_ptr + i, out0, 0); - } - if (i == 1) { - vst1q_lane_f32(output_ptr + i, out0, 1); - } - if (i == 2) { - vst1q_lane_f32(output_ptr + i, out0, 2); - } - } - } - output_data += hxw; - input_data += hxw; - filter_data_tmp += 9; - } - } -} -} // namespace math -} // namespace operators -} // namespace paddle_mobile diff --git a/src/operators/op_param.h b/src/operators/op_param.h index 009765f2e05482f0e310990b4f7f85b6b0442970..f713199c7fe751a6f9dc529107a5af374a848f7c 100644 --- a/src/operators/op_param.h +++ b/src/operators/op_param.h @@ -848,52 +848,143 @@ class FusionConvAddReluParam : public FusionConvAddParam { }; #endif -class Im2SequenceParam : public OpParam { +#ifdef FUSION_CONVADDBNRELU_OP +class FusionConvAddBNReluParam : public OpParam { public: - Im2SequenceParam(const VariableNameMap &inputs, - const VariableNameMap &outputs, const AttributeMap &attrs, - const Scope &scope) { - input_x_ = InputXFrom(inputs, scope); - out_ = OutFrom(outputs, scope); - kernels_ = GetAttr>("kernels", attrs); + FusionConvAddBNReluParam(const VariableNameMap &inputs, + const VariableNameMap &outputs, + const AttributeMap &attrs, const Scope &scope) { + bias_ = InputYFrom(inputs, scope); + axis_ = GetAttr("axis", attrs); + filter_ = FilterFrom(inputs, scope); + input_ = InputFrom(inputs, scope); + output_ = OutFrom(outputs, scope); strides_ = GetAttr>("strides", attrs); paddings_ = GetAttr>("paddings", attrs); + dilations_ = GetAttr>("dilations", attrs); + groups = GetAttr("groups", attrs); + input_bias_ = InputBiasFrom(inputs, scope); + input_mean_ = InputMeanFrom(inputs, scope); + input_scale_ = InputScaleFrom(inputs, scope); + input_variance_ = InputVarianceFrom(inputs, scope); + epsilon_ = GetAttr("epsilon", attrs); + momentum_ = GetAttr("momentum", attrs); + is_test_ = GetAttr("is_test", attrs); } + Tensor *Bias() const { return bias_; } - const Tensor *Input() const { return input_x_; } + const int &Axis() const { return axis_; } - Tensor *Output() const { return out_; } + const Tensor *Input() const { return input_; } - const vector &Kernels() const { return kernels_; } + const Tensor *Filter() const { return filter_; } + + Tensor *Output() const { return output_; } const vector &Strides() const { return strides_; } const vector &Paddings() const { return paddings_; } - private: - Tensor *input_x_; - Tensor *out_; - vector kernels_; - vector strides_; - vector paddings_; -}; + const vector &Dilations() const { return dilations_; } -class DropoutParam : public OpParam { - public: - DropoutParam(const VariableNameMap &inputs, const VariableNameMap &outputs, - const AttributeMap &attrs, const Scope &scope) { - input_x_ = InputXFrom(inputs, scope); - out_ = OutFrom(outputs, scope); - } + const int &Groups() const { return groups; } - const Tensor *InputX() const { return input_x_; } + const Tensor *InputBias() const { return input_bias_; } - Tensor *Out() const { return out_; } + const Tensor *InputMean() const { return input_mean_; } - private: - Tensor *input_x_; - Tensor *out_; + const Tensor *InputScale() const { return input_scale_; } + + const Tensor *InputVariance() const { return input_variance_; } + + const float &Epsilon() const { return epsilon_; } + + const float &Momentum() const { return momentum_; } + + const bool &IsTest() const { return is_test_; } + + void SetNewScale(Tensor *new_scale) { new_scale_ = new_scale; } + + void SetNewBias(Tensor *new_bias) { new_bias_ = new_bias; } + + const Tensor *NewScale() const { return new_scale_; } + + const Tensor *NewBias() const { return new_bias_; } + + protected: + Tensor *bias_; + int axis_; + Tensor *input_; + Tensor *output_; + Tensor *filter_; + vector strides_; + vector paddings_; + vector dilations_; + int groups; + Tensor *input_bias_; + Tensor *input_mean_; + Tensor *input_scale_; + Tensor *input_variance_; + float epsilon_; + float momentum_; + bool is_test_; + Tensor *new_bias_; + Tensor *new_scale_; }; +Print &operator<<(Print &printer, const FusionConvAddParam &conv_param); +#endif + + #ifdef IM2SEQUENCE_OP + class Im2SequenceParam : public OpParam { + public: + Im2SequenceParam(const VariableNameMap &inputs, + const VariableNameMap &outputs, const AttributeMap &attrs, + const Scope &scope) { + input_x_ = InputXFrom(inputs, scope); + out_ = OutFrom(outputs, scope); + kernels_ = GetAttr>("kernels", attrs); + strides_ = GetAttr>("strides", attrs); + paddings_ = GetAttr>("paddings", attrs); + } + + const Tensor *Input() const { return input_x_; } + + Tensor *Output() const { return out_; } + + const vector &Kernels() const { return kernels_; } + + const vector &Strides() const { return strides_; } + + const vector &Paddings() const { return paddings_; } + + private: + Tensor *input_x_; + Tensor *out_; + vector kernels_; + vector strides_; + vector paddings_; + }; +#endif + +#ifdef DROPOUT_OP + class DropoutParam : public OpParam { + public: + DropoutParam(const VariableNameMap &inputs, const VariableNameMap &outputs, + const AttributeMap &attrs, const Scope &scope) { + input_x_ = InputXFrom(inputs, scope); + out_ = OutFrom(outputs, scope); + } + + const Tensor *InputX() const { return input_x_; } + + Tensor *Out() const { return out_; } + + private: + Tensor *input_x_; + Tensor *out_; + }; +#endif + } // namespace operators } // namespace paddle_mobile diff --git a/test/framework/test_load.cpp b/test/framework/test_load.cpp index 8c76eb1dde3ef39a342d19e7f3d4e26fc1be2b2f..05b60d3e9105fc7576d29b7c24c94e2a28c85a70 100644 --- a/test/framework/test_load.cpp +++ b/test/framework/test_load.cpp @@ -19,7 +19,7 @@ int main() { paddle_mobile::Loader loader; // ../../../test/models/googlenet // ../../../test/models/mobilenet - auto program = loader.Load(g_mobilenet_ssd, false, false); + auto program = loader.Load(g_googlenet, true); // auto program = loader.Load(g_googlenet_combine + "/model", // g_googlenet_combine + // "/params", true); diff --git a/tools/build.sh b/tools/build.sh index 42e872c580cffef3bd904dc9cc575e9961ef4257..86ae8b5e1aa16c7cab66580bc2eaa6e1e526fc17 100755 --- a/tools/build.sh +++ b/tools/build.sh @@ -31,7 +31,7 @@ build_for_mac() { } build_for_android() { - rm -rf "../build" + #rm -rf "../build" if [ -z "${ANDROID_NDK}" ]; then echo "ANDROID_NDK not found!" exit -1 diff --git a/tools/op.cmake b/tools/op.cmake index e35aa5248b0f4b1844bc71e88a23ac54ac4eaf31..8c9182f900ac4e180f30e3fb3f16015b034e4458 100644 --- a/tools/op.cmake +++ b/tools/op.cmake @@ -22,6 +22,7 @@ elseif (NET EQUAL "mobilenet") set(BATCHNORM_OP ON) set(POOL_OP ON) set(RESHAPE_OP ON) + set(FUSION_CONVADDBNRELU_OP) elseif (NET EQUAL "yolo") set(BATCHNORM_OP ON) set(CONV_OP ON) @@ -64,6 +65,7 @@ else () set(SOFTMAX_OP ON) set(TRANSPOSE_OP ON) set(FUSION_CONVADD_RELU_OP ON) + set(FUSION_CONVADDBNRELU_OP ON) set(DROPOUT_OP ON) set(IM2SEQUENCE_OP ON) # option(BATCHNORM_OP "" ON) @@ -148,6 +150,9 @@ endif() if (FUSION_CONVADD_RELU_OP) add_definitions(-DFUSION_CONVADD_RELU_OP) endif() +if (FUSION_CONVADDBNRELU_OP) + add_definitions(-DFUSION_CONVADDBNRELU_OP) +endif() if (DROPOUT_OP) add_definitions(-DDROPOUT_OP) endif()