Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
cd00d9b4
P
Paddle
项目概览
机器未来
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
cd00d9b4
编写于
7月 04, 2022
作者:
R
Ruibiao Chen
提交者:
GitHub
7月 04, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove boost::blank (#44028)
上级
c5dbcc8c
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
69 addition
and
18 deletion
+69
-18
paddle/fluid/framework/attribute.cc
paddle/fluid/framework/attribute.cc
+2
-2
paddle/fluid/framework/ir/generate_pass.cc
paddle/fluid/framework/ir/generate_pass.cc
+3
-3
paddle/fluid/framework/op_desc.cc
paddle/fluid/framework/op_desc.cc
+2
-2
paddle/fluid/framework/type_defs.h
paddle/fluid/framework/type_defs.h
+3
-3
paddle/fluid/platform/device/ipu/ipu_compiler.cc
paddle/fluid/platform/device/ipu/ipu_compiler.cc
+4
-4
paddle/phi/api/ext/op_meta_info.h
paddle/phi/api/ext/op_meta_info.h
+1
-1
paddle/phi/core/enforce.cc
paddle/phi/core/enforce.cc
+2
-3
paddle/utils/blank.h
paddle/utils/blank.h
+52
-0
未找到文件。
paddle/fluid/framework/attribute.cc
浏览文件 @
cd00d9b4
...
...
@@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/framework/attribute.h"
#include "
boost/blank.hpp
"
#include "
paddle/utils/blank.h
"
namespace
paddle
{
namespace
framework
{
...
...
@@ -118,7 +118,7 @@ Attribute GetAttrValue(const proto::OpDesc::Attr& attr_desc) {
PADDLE_THROW
(
platform
::
errors
::
Unavailable
(
"Unsupport attribute type %d."
,
attr_desc
.
type
()));
}
return
boost
::
blank
();
return
paddle
::
blank
();
}
}
// namespace framework
...
...
paddle/fluid/framework/ir/generate_pass.cc
浏览文件 @
cd00d9b4
...
...
@@ -14,8 +14,8 @@
#include "paddle/fluid/framework/ir/generate_pass.h"
#include "boost/blank.hpp"
#include "paddle/fluid/framework/ir/graph_pattern_detector.h"
#include "paddle/utils/blank.h"
namespace
paddle
{
namespace
framework
{
...
...
@@ -40,7 +40,7 @@ class element_visitor : public boost::static_visitor<Attribute> {
if
(
index
>=
0
&&
static_cast
<
size_t
>
(
index
)
<
attr
.
size
())
{
return
static_cast
<
ET
>
(
attr
[
index
]);
}
return
boost
::
blank
();
return
paddle
::
blank
();
}
private:
...
...
@@ -99,7 +99,7 @@ Attribute GetVarAttrValue(const VarDesc* desc,
return
shape
;
}
}
return
boost
::
blank
();
return
paddle
::
blank
();
}
Attribute
GetOpAttrValue
(
const
OpDesc
*
desc
,
...
...
paddle/fluid/framework/op_desc.cc
浏览文件 @
cd00d9b4
...
...
@@ -16,7 +16,6 @@ limitations under the License. */
#include <string>
#include "boost/blank.hpp"
#include "glog/logging.h"
#include "paddle/fluid/framework/block_desc.h"
#include "paddle/fluid/framework/op_call_stack.h"
...
...
@@ -24,6 +23,7 @@ limitations under the License. */
#include "paddle/fluid/framework/operator.h"
#include "paddle/fluid/framework/shape_inference.h"
#include "paddle/fluid/framework/var_type_inference.h"
#include "paddle/utils/blank.h"
namespace
paddle
{
namespace
framework
{
...
...
@@ -810,7 +810,7 @@ struct SetAttrDescVisitor : public boost::static_visitor<void> {
VectorToRepeated
(
v
,
attr_
->
mutable_float64s
());
}
void
operator
()(
boost
::
blank
)
const
{
void
operator
()(
paddle
::
blank
)
const
{
PADDLE_THROW
(
platform
::
errors
::
Unavailable
(
"Unsupported calling method of SetAttrDescVisitor object for "
"`boosst::blank` type."
));
...
...
paddle/fluid/framework/type_defs.h
浏览文件 @
cd00d9b4
...
...
@@ -22,9 +22,9 @@ limitations under the License. */
#include <unordered_set>
#include <vector>
#include "boost/blank.hpp"
#include "paddle/fluid/imperative/type_defs.h"
#include "paddle/fluid/platform/variant.h"
#include "paddle/utils/blank.h"
#include "paddle/utils/small_vector.h"
#include "paddle/utils/variant.h"
...
...
@@ -42,7 +42,7 @@ class InferNoNeedBufferVarsFN;
using
VariableNameMap
=
std
::
map
<
std
::
string
,
std
::
vector
<
std
::
string
>>
;
using
VariableValueMap
=
std
::
map
<
std
::
string
,
std
::
vector
<
Variable
*>>
;
using
Attribute
=
paddle
::
variant
<
boost
::
blank
,
using
Attribute
=
paddle
::
variant
<
paddle
::
blank
,
int
,
float
,
std
::
string
,
...
...
@@ -59,7 +59,7 @@ using Attribute = paddle::variant<boost::blank,
using
AttributeMap
=
std
::
unordered_map
<
std
::
string
,
Attribute
>
;
#ifdef PADDLE_WITH_ASCEND_CL
using
NPUAttribute
=
paddle
::
variant
<
boost
::
blank
,
using
NPUAttribute
=
paddle
::
variant
<
paddle
::
blank
,
int
,
float
,
std
::
string
,
...
...
paddle/fluid/platform/device/ipu/ipu_compiler.cc
浏览文件 @
cd00d9b4
...
...
@@ -19,7 +19,7 @@
#include <popart/optimizer.hpp>
#include <popart/sgd.hpp>
#include "
boost/blank.hpp
"
#include "
paddle/utils/blank.h
"
#include "paddle/fluid/framework/ir/graph_helper.h"
#include "paddle/fluid/platform/device/ipu/ipu_names.h"
...
...
@@ -75,9 +75,9 @@ struct CustomOpAttrVisitor : public boost::static_visitor<void> {
void
operator
()(
const
std
::
vector
<
double
>&
v
)
const
{
attrs_
->
emplace
(
attr_name_
,
v
);
}
void
operator
()(
boost
::
blank
)
const
{
void
operator
()(
paddle
::
blank
)
const
{
PADDLE_THROW
(
platform
::
errors
::
Unavailable
(
"Unsupported calling method for `
boost
::blank` type when extracting "
"Unsupported calling method for `
paddle
::blank` type when extracting "
"custom operator attributes."
));
}
};
...
...
@@ -124,7 +124,7 @@ struct ConstantOpAttrVisitor : public boost::static_visitor<void> {
void
operator
()(
BlockDesc
*
desc
)
const
{
RAISE_ERROR
;
}
void
operator
()(
const
std
::
vector
<
BlockDesc
*>&
v
)
const
{
RAISE_ERROR
;
}
void
operator
()(
int64_t
v
)
const
{
RAISE_ERROR
;
}
void
operator
()(
boost
::
blank
)
const
{
RAISE_ERROR
;
}
void
operator
()(
paddle
::
blank
)
const
{
RAISE_ERROR
;
}
#undef RAISE_ERROR
};
...
...
paddle/phi/api/ext/op_meta_info.h
浏览文件 @
cd00d9b4
...
...
@@ -213,7 +213,7 @@ struct KernelFuncImpl<Return (*)(Args...), impl_fn> {
PD_SPECIALIZE_ComputeCallHelper
(
const
std
::
vector
<
std
::
string
>&
);
// TODO(chenweihang): support other attribute type if needed.
// Why not support other attribute type here?
// -
boost
::blank, std::vector<bool> and std::vector<double>
// -
paddle
::blank, std::vector<bool> and std::vector<double>
// are not used in op
// - BlockDesc* and std::vector<BlockDesc*> are used in framework
...
...
paddle/phi/core/enforce.cc
浏览文件 @
cd00d9b4
...
...
@@ -14,13 +14,12 @@ limitations under the License. */
#include "paddle/phi/core/enforce.h"
#include <boost/variant.hpp>
#include <map>
#include <memory>
#include <unordered_map>
#include <vector>
#include "
boost/blank.hpp
"
#include "
paddle/utils/blank.h
"
#include "paddle/utils/variant.h"
namespace
egr
{
...
...
@@ -29,7 +28,7 @@ class EagerVariable;
namespace
paddle
{
namespace
framework
{
class
BlockDesc
;
using
Attribute
=
paddle
::
variant
<
boost
::
blank
,
using
Attribute
=
paddle
::
variant
<
paddle
::
blank
,
int
,
float
,
std
::
string
,
...
...
paddle/utils/blank.h
0 → 100644
浏览文件 @
cd00d9b4
/* Copyright (c) 2022 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. */
// This file copy from boost/blank.hpp, boost version: 1.41.0
// Modified the following points:
// 1. modify namespace from boost to paddle
// 2. remove the depending boost header files
// 3. remove the type traits specializations
// 4. remove streaming support
//-----------------------------------------------------------------------------
// boost blank.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2003
// Eric Friedman
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#pragma once
namespace
paddle
{
struct
blank
{};
inline
bool
operator
==
(
const
blank
&
,
const
blank
&
)
{
return
true
;
}
inline
bool
operator
<=
(
const
blank
&
,
const
blank
&
)
{
return
true
;
}
inline
bool
operator
>=
(
const
blank
&
,
const
blank
&
)
{
return
true
;
}
inline
bool
operator
!=
(
const
blank
&
,
const
blank
&
)
{
return
false
;
}
inline
bool
operator
<
(
const
blank
&
,
const
blank
&
)
{
return
false
;
}
inline
bool
operator
>
(
const
blank
&
,
const
blank
&
)
{
return
false
;
}
}
// namespace paddle
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录