提交 1aaa58b4 编写于 作者: 朔-望's avatar 朔-望

Merge remote-tracking branch 'upstream/develop' into develop

/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
#include "data_transform.h" #include "framework/data_transform.h"
namespace paddle_mobile { namespace paddle_mobile {
namespace framework { namespace framework {
...@@ -69,7 +65,7 @@ void DataTransform(const OpKernelType &expected_kernel_type, ...@@ -69,7 +65,7 @@ void DataTransform(const OpKernelType &expected_kernel_type,
} }
void CopyVariableWithTensor(const Variable &in_var, const Tensor &tensor, void CopyVariableWithTensor(const Variable &in_var, const Tensor &tensor,
Variable &out_var) { Variable *out_var) {
// if (in_var.IsType<LoDTensor>()) { // if (in_var.IsType<LoDTensor>()) {
// auto& in_lod_tensor = in_var.Get<LoDTensor>(); // auto& in_lod_tensor = in_var.Get<LoDTensor>();
// auto* tran_lod_tensor = out_var.GetMutable<LoDTensor>(); // auto* tran_lod_tensor = out_var.GetMutable<LoDTensor>();
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
...@@ -22,10 +18,10 @@ SOFTWARE. ...@@ -22,10 +18,10 @@ SOFTWARE.
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "op_kernel_type.h" #include "framework/op_kernel_type.h"
#include "selected_rows.h" #include "framework/selected_rows.h"
#include "tensor.h" #include "framework/tensor.h"
#include "variable.h" #include "framework/variable.h"
namespace paddle_mobile { namespace paddle_mobile {
namespace framework { namespace framework {
...@@ -35,7 +31,7 @@ void DataTransform(const OpKernelType &expected_kernel_type, ...@@ -35,7 +31,7 @@ void DataTransform(const OpKernelType &expected_kernel_type,
const Tensor &input_tensor, Tensor *out); const Tensor &input_tensor, Tensor *out);
void CopyVariableWithTensor(const Variable &in_var, const Tensor &tensor, void CopyVariableWithTensor(const Variable &in_var, const Tensor &tensor,
Variable &out_var); Variable *out_var);
} // namespace framework } // namespace framework
} // namespace paddle_mobile } // namespace paddle_mobile
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
#include "framework.pb.h" #include "framework/framework.pb.h"
namespace paddle_mobile { namespace paddle_mobile {
namespace framework { namespace framework {
...@@ -39,5 +35,5 @@ namespace framework { ...@@ -39,5 +35,5 @@ namespace framework {
//// PADDLE_THROW("Not supported"); //// PADDLE_THROW("Not supported");
// } // }
// } // }
} } // namespace framework
} // namespace paddle_mobile } // namespace paddle_mobile
...@@ -33,7 +33,7 @@ namespace framework { ...@@ -33,7 +33,7 @@ namespace framework {
template <typename Dtype> template <typename Dtype>
class Executor { class Executor {
public: public:
Executor(); Executor() = default;
Executor(const Program<Dtype> p); Executor(const Program<Dtype> p);
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
#include "data_layout.h" #include "framework/data_layout.h"
#include "framework.pb.h" #include "framework/framework.pb.h"
namespace paddle_mobile { namespace paddle_mobile {
namespace framework { namespace framework {
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE #include "framework/operator.h"
SOFTWARE. #include "framework/op_info.h"
==============================================================================*/
#include "operator.h"
#include "op_info.h"
namespace paddle_mobile { namespace paddle_mobile {
namespace framework { namespace framework {
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include <fstream> #include <fstream>
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include "operators/conv_op.h" #include "operators/conv_op.h"
#include <vector> #include <vector>
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include "operators/kernel/conv_kernel.h" #include "operators/kernel/conv_kernel.h"
...@@ -141,8 +137,9 @@ void ConvKernel<CPU, float>::Compute(const ConvParam &param) const { ...@@ -141,8 +137,9 @@ void ConvKernel<CPU, float>::Compute(const ConvParam &param) const {
// gemm // gemm
Tensor out_slice = out_batch.Slice(g * out_step, (g + 1) * out_step); 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); Tensor filter_slice = filter.Slice(g * out_step, (g + 1) * out_step);
math::matmul<float>(filter_slice, false, col_matrix, false, float(1.0), math::matmul<float>(filter_slice, false, col_matrix, false,
&out_slice, float(0.0)); static_cast<float>(1), &out_slice,
static_cast<float>(0));
} }
} }
} }
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include <operators/kernel/pool_kernel.h> #include <operators/kernel/pool_kernel.h>
#include "common/log.h" #include "common/log.h"
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include "../softmax_kernel.h" #include "../softmax_kernel.h"
#include "../../math/softmax.h" #include "../../math/softmax.h"
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include "framework/operator.h" #include "framework/operator.h"
#include "operators/math/im2col.h" #include "operators/math/im2col.h"
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
namespace paddle_mobile { namespace paddle_mobile {
namespace operators { namespace operators {
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
#include "framework/operator.h" #include "framework/operator.h"
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
#include "framework/operator.h" #include "framework/operator.h"
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include "operators/math/Gemm.h" #include "operators/math/Gemm.h"
#include <iostream> #include <iostream>
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
......
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
...@@ -12,7 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,7 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "im2col.h" #include "operators/math/im2col.h"
#include <vector>
#include "common/types.h" #include "common/types.h"
namespace paddle_mobile { namespace paddle_mobile {
......
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
...@@ -14,6 +14,7 @@ limitations under the License. */ ...@@ -14,6 +14,7 @@ limitations under the License. */
#pragma once #pragma once
#include <vector>
#include "framework/tensor.h" #include "framework/tensor.h"
namespace paddle_mobile { namespace paddle_mobile {
......
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
...@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "math_function.h" #include "operators/math/math_function.h"
namespace paddle_mobile { namespace paddle_mobile {
namespace operators { namespace operators {
......
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
#if __ARM_NEON #if __ARM_NEON
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
#if __ARM_NEON #if __ARM_NEON
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include "pooling.h" #include "pooling.h"
#include <common/types.h> #include <common/types.h>
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include "operators/math/softmax.h" #include "operators/math/softmax.h"
#include "common/types.h" #include "common/types.h"
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
#include "framework/tensor.h" #include "framework/tensor.h"
......
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
...@@ -12,7 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ...@@ -12,7 +12,8 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and See the License for the specific language governing permissions and
limitations under the License. */ limitations under the License. */
#include "vol2col.h" #include "operators/math/vol2col.h"
#include <vector>
namespace paddle_mobile { namespace paddle_mobile {
namespace operators { namespace operators {
......
/* Copyright (c) 2016 PaddlePaddle Authors. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
...@@ -14,6 +14,7 @@ limitations under the License. */ ...@@ -14,6 +14,7 @@ limitations under the License. */
#pragma once #pragma once
#include <vector>
#include "common/types.h" #include "common/types.h"
#include "framework/tensor.h" #include "framework/tensor.h"
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include "op_param.h" #include "op_param.h"
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#pragma once #pragma once
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved. /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal Licensed under the Apache License, Version 2.0 (the "License");
in the Software without restriction, including without limitation the rights you may not use this file except in compliance with the License.
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell You may obtain a copy of the License at
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions: http://www.apache.org/licenses/LICENSE-2.0
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software. Unless required by applicable law or agreed to in writing, software
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR distributed under the License is distributed on an "AS IS" BASIS,
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE See the License for the specific language governing permissions and
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER limitations under the License. */
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include <iostream> #include <iostream>
#include "common/log.h" #include "common/log.h"
......
/* Copyright (c) 2016 Baidu, Inc. All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
==============================================================================*/
#include "common/log.h" #include "common/log.h"
int main() { int main() {
......
...@@ -34,9 +34,9 @@ int main() { ...@@ -34,9 +34,9 @@ int main() {
paddle_mobile::framework::Tensor input; paddle_mobile::framework::Tensor input;
SetupTensor<float>(&input, {1, 3, 32, 32}, static_cast<float>(0), SetupTensor<float>(&input, {1, 3, 32, 32}, static_cast<float>(0),
static_cast<float>(1)); static_cast<float>(1));
auto out_ddim = paddle_mobile::framework::make_ddim({1, 64, 56, 56});
auto output = auto output =
executor.predict(input, "data", "conv2d_0.tmp_0", {1, 64, 56, 56}); executor.predict(input, "data", "conv2d_0.tmp_0", out_ddim);
auto output_ptr = output->data<float>(); auto output_ptr = output->data<float>();
for (int j = 0; j < output->numel(); ++j) { for (int j = 0; j < output->numel(); ++j) {
......
...@@ -30,9 +30,9 @@ int main() { ...@@ -30,9 +30,9 @@ int main() {
paddle_mobile::framework::Tensor input; paddle_mobile::framework::Tensor input;
SetupTensor<float>(&input, {1, 64, 112, 112}, static_cast<float>(0), SetupTensor<float>(&input, {1, 64, 112, 112}, static_cast<float>(0),
static_cast<float>(1)); static_cast<float>(1));
auto out_ddim = paddle_mobile::framework::make_ddim({1, 64, 56, 56});
auto output = executor.predict(input, "conv2d_0.tmp_1", "pool2d_0.tmp_0", auto output =
{1, 64, 56, 56}); executor.predict(input, "conv2d_0.tmp_1", "pool2d_0.tmp_0", out_ddim);
float *output_ptr = output->data<float>(); float *output_ptr = output->data<float>();
for (int j = 0; j < output->numel(); ++j) { for (int j = 0; j < output->numel(); ++j) {
......
...@@ -23,13 +23,14 @@ int main() { ...@@ -23,13 +23,14 @@ int main() {
DLOG << "program read file"; DLOG << "program read file";
} }
Executor4Test<paddle_mobile::CPU, Executor4Test<paddle_mobile::CPU,
paddle_mobile::operators::SoftmaxOp<paddle_mobile::CPU, float>> paddle_mobile::operators::SoftmaxOp<paddle_mobile::CPU, float>>
executor(program, "softmax"); executor(program, "softmax");
paddle_mobile::framework::Tensor input; paddle_mobile::framework::Tensor input;
SetupTensor<float>(&input, {1, 1000}, static_cast<float>(0), SetupTensor<float>(&input, {1, 1000}, static_cast<float>(0),
static_cast<float>(1)); static_cast<float>(1));
auto output = executor.predict(input, "reshape_0.tmp_0", "softmax_0.tmp_0", auto out_ddim = paddle_mobile::framework::make_ddim({1, 1000});
{1, 1000}); auto output =
executor.predict(input, "reshape_0.tmp_0", "softmax_0.tmp_0", out_ddim);
auto *output_ptr = output->data<float>(); auto *output_ptr = output->data<float>();
for (int j = 0; j < output->numel(); ++j) { for (int j = 0; j < output->numel(); ++j) {
DLOG << " value of output: " << output_ptr[j]; DLOG << " value of output: " << output_ptr[j];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册