Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
d2045260
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
694
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d2045260
编写于
11月 24, 2018
作者:
M
minqiyang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Change visibilities of variant_visitor of pybind11
test=develop
上级
b6722918
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
9 addition
and
9 deletion
+9
-9
paddle/fluid/pybind/protobuf.cc
paddle/fluid/pybind/protobuf.cc
+7
-6
paddle/fluid/pybind/pybind.cc
paddle/fluid/pybind/pybind.cc
+2
-3
未找到文件。
paddle/fluid/pybind/protobuf.cc
浏览文件 @
d2045260
...
@@ -30,11 +30,12 @@ namespace pybind11 {
...
@@ -30,11 +30,12 @@ namespace pybind11 {
namespace
detail
{
namespace
detail
{
// Can be replaced by a generic lambda in C++14
// Can be replaced by a generic lambda in C++14
struct
variant_caster_visitor
:
public
boost
::
static_visitor
<
handle
>
{
struct
__attribute__
((
visibility
(
"hidden"
)))
paddle_variant_caster_visitor
:
public
boost
::
static_visitor
<
handle
>
{
return_value_policy
policy
;
return_value_policy
policy
;
handle
parent
;
handle
parent
;
variant_caster_visitor
(
return_value_policy
policy
,
handle
parent
)
paddle_
variant_caster_visitor
(
return_value_policy
policy
,
handle
parent
)
:
policy
(
policy
),
parent
(
parent
)
{}
:
policy
(
policy
),
parent
(
parent
)
{}
template
<
class
T
>
template
<
class
T
>
...
@@ -44,10 +45,10 @@ struct variant_caster_visitor : public boost::static_visitor<handle> {
...
@@ -44,10 +45,10 @@ struct variant_caster_visitor : public boost::static_visitor<handle> {
};
};
template
<
class
Variant
>
template
<
class
Variant
>
struct
variant_caster
;
struct
paddle_
variant_caster
;
template
<
template
<
class
...
>
class
V
,
class
...
Ts
>
template
<
template
<
class
...
>
class
V
,
class
...
Ts
>
struct
variant_caster
<
V
<
Ts
...
>>
{
struct
paddle_
variant_caster
<
V
<
Ts
...
>>
{
using
Type
=
V
<
Ts
...
>
;
using
Type
=
V
<
Ts
...
>
;
template
<
typename
T
>
template
<
typename
T
>
...
@@ -90,7 +91,7 @@ struct variant_caster<V<Ts...>> {
...
@@ -90,7 +91,7 @@ struct variant_caster<V<Ts...>> {
static
handle
cast
(
Type
const
&
src
,
return_value_policy
policy
,
static
handle
cast
(
Type
const
&
src
,
return_value_policy
policy
,
handle
parent
)
{
handle
parent
)
{
variant_caster_visitor
visitor
(
policy
,
parent
);
paddle_
variant_caster_visitor
visitor
(
policy
,
parent
);
return
boost
::
apply_visitor
(
visitor
,
src
);
return
boost
::
apply_visitor
(
visitor
,
src
);
}
}
...
@@ -101,7 +102,7 @@ struct variant_caster<V<Ts...>> {
...
@@ -101,7 +102,7 @@ struct variant_caster<V<Ts...>> {
// Add specialization for concrete variant type
// Add specialization for concrete variant type
template
<
class
...
Args
>
template
<
class
...
Args
>
struct
type_caster
<
boost
::
variant
<
Args
...
>>
struct
type_caster
<
boost
::
variant
<
Args
...
>>
:
variant_caster
<
boost
::
variant
<
Args
...
>>
{};
:
paddle_
variant_caster
<
boost
::
variant
<
Args
...
>>
{};
}
// namespace detail
}
// namespace detail
}
// namespace pybind11
}
// namespace pybind11
...
...
paddle/fluid/pybind/pybind.cc
浏览文件 @
d2045260
...
@@ -86,12 +86,12 @@ bool IsCompiledWithDIST() {
...
@@ -86,12 +86,12 @@ bool IsCompiledWithDIST() {
#endif
#endif
}
}
PYBIND11_MODULE
(
core
)
{
PYBIND11_MODULE
(
core
,
m
)
{
// Not used, just make sure cpu_info.cc is linked.
// Not used, just make sure cpu_info.cc is linked.
paddle
::
platform
::
CpuTotalPhysicalMemory
();
paddle
::
platform
::
CpuTotalPhysicalMemory
();
paddle
::
memory
::
allocation
::
UseAllocatorStrategyGFlag
();
paddle
::
memory
::
allocation
::
UseAllocatorStrategyGFlag
();
py
::
module
m
(
"core"
,
"C++ core of PaddlePaddle"
)
;
m
.
doc
()
=
"C++ core of PaddlePaddle"
;
// using framework in this function. Since it is inside a function, it will
// using framework in this function. Since it is inside a function, it will
// not cause namespace pollution.
// not cause namespace pollution.
...
@@ -907,7 +907,6 @@ All parameter, weight, gradient are variables in Paddle.
...
@@ -907,7 +907,6 @@ All parameter, weight, gradient are variables in Paddle.
});
});
BindRecordIOWriter
(
&
m
);
BindRecordIOWriter
(
&
m
);
return
m
.
ptr
();
}
}
}
// namespace pybind
}
// namespace pybind
}
// namespace paddle
}
// namespace paddle
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录