File tree Expand file tree Collapse file tree 5 files changed +40
-12
lines changed Expand file tree Collapse file tree 5 files changed +40
-12
lines changed Original file line number Diff line number Diff line change
1
+ /* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
2
+
3
+ Licensed under the Apache License, Version 2.0 (the "License");
4
+ you may not use this file except in compliance with the License.
5
+ You may obtain a copy of the License at
6
+
7
+ http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Unless required by applicable law or agreed to in writing, software
10
+ distributed under the License is distributed on an "AS IS" BASIS,
11
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ See the License for the specific language governing permissions and
13
+ limitations under the License. */
14
+
15
+ #pragma once
16
+
17
+ // workaround for Python 2 issue: https://bugs.python.org/issue17120
18
+ #pragma push_macro("_XOPEN_SOURCE")
19
+ #pragma push_macro("_POSIX_C_SOURCE")
20
+ #undef _XOPEN_SOURCE
21
+ #undef _POSIX_C_SOURCE
22
+
23
+ #include "pybind11/pybind11.h"
24
+
25
+ #pragma pop_macro("_XOPEN_SOURCE")
26
+ #pragma pop_macro("_POSIX_C_SOURCE")
Original file line number Diff line number Diff line change 14
14
15
15
#pragma once
16
16
17
- #include < map>
18
- #include < string>
19
- #include < vector>
17
+ // clang-format off
18
+ #include " paddle/fluid/framework/python_headers.h"
19
+ // clang-format on
20
+
21
+ #include < map> // NOLINT
22
+ #include < string> // NOLINT
23
+ #include < vector> // NOLINT
20
24
21
25
#include " paddle/fluid/framework/op_desc.h"
22
26
#include " paddle/fluid/framework/operator.h"
23
27
#include " paddle/fluid/framework/var_desc.h"
24
28
#include " paddle/fluid/platform/enforce.h"
25
- #include " pybind11/pybind11.h"
26
29
27
30
#include " paddle/fluid/imperative/type_defs.h"
28
31
Original file line number Diff line number Diff line change 14
14
15
15
#pragma once
16
16
17
+ #include < map>
17
18
#include < string>
18
19
#include < vector>
19
20
@@ -39,11 +40,10 @@ class Tracer {
39
40
40
41
virtual ~Tracer () {}
41
42
42
- void Trace (
43
- OpBase* op,
44
- const std::map<std::string, std::vector<VarBase*>>& inputs, // NOLINT
45
- const std::map<std::string, std::vector<VarBase*>>& outputs, // NOLINT
46
- framework::BlockDesc* block, const bool stop_gradient = false );
43
+ void Trace (OpBase* op,
44
+ const std::map<std::string, std::vector<VarBase*>>& inputs,
45
+ const std::map<std::string, std::vector<VarBase*>>& outputs,
46
+ framework::BlockDesc* block, const bool stop_gradient = false );
47
47
48
48
std::vector<VarBase*> PyTrace (OpBase* op, const std::vector<VarBase*>& inputs,
49
49
bool stop_gradient = false );
Original file line number Diff line number Diff line change 13
13
// limitations under the License.
14
14
15
15
#include " paddle/fluid/operators/py_func_op.h"
16
+
16
17
#include < set>
17
18
#include < string>
18
19
#include < vector>
19
- #include " Python.h"
20
20
#include " paddle/fluid/framework/op_registry.h"
21
21
22
22
namespace paddle {
Original file line number Diff line number Diff line change 13
13
// limitations under the License.
14
14
15
15
#pragma once
16
-
17
- #include " pybind11/pybind11.h"
16
+ #include " paddle/fluid/framework/python_headers.h"
18
17
19
18
namespace paddle {
20
19
namespace operators {
You can’t perform that action at this time.
0 commit comments