Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
9a970702
P
Paddle
项目概览
BaiXuePrincess
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9a970702
编写于
2月 02, 2018
作者:
F
fengjiayi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
remove unnecessary framework::
上级
ab1341ea
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
12 addition
and
13 deletion
+12
-13
paddle/framework/shape_inference.cc
paddle/framework/shape_inference.cc
+6
-6
paddle/framework/shape_inference.h
paddle/framework/shape_inference.h
+6
-7
未找到文件。
paddle/framework/shape_inference.cc
浏览文件 @
9a970702
...
@@ -18,7 +18,7 @@ limitations under the License. */
...
@@ -18,7 +18,7 @@ limitations under the License. */
namespace
paddle
{
namespace
paddle
{
namespace
framework
{
namespace
framework
{
framework
::
DDim
InferShapeContext
::
GetInputDim
(
const
std
::
string
&
name
)
const
{
DDim
InferShapeContext
::
GetInputDim
(
const
std
::
string
&
name
)
const
{
const
std
::
vector
<
std
::
string
>
&
arg_names
=
Inputs
(
name
);
const
std
::
vector
<
std
::
string
>
&
arg_names
=
Inputs
(
name
);
PADDLE_ENFORCE_EQ
(
arg_names
.
size
(),
1UL
,
PADDLE_ENFORCE_EQ
(
arg_names
.
size
(),
1UL
,
"Input(%s) should hold one element, but now it holds %d"
,
"Input(%s) should hold one element, but now it holds %d"
,
...
@@ -26,7 +26,7 @@ framework::DDim InferShapeContext::GetInputDim(const std::string &name) const {
...
@@ -26,7 +26,7 @@ framework::DDim InferShapeContext::GetInputDim(const std::string &name) const {
return
this
->
GetDim
(
arg_names
[
0
]);
return
this
->
GetDim
(
arg_names
[
0
]);
}
}
std
::
vector
<
framework
::
DDim
>
InferShapeContext
::
GetInputsDim
(
std
::
vector
<
DDim
>
InferShapeContext
::
GetInputsDim
(
const
std
::
string
&
name
)
const
{
const
std
::
string
&
name
)
const
{
const
std
::
vector
<
std
::
string
>
&
arg_names
=
Inputs
(
name
);
const
std
::
vector
<
std
::
string
>
&
arg_names
=
Inputs
(
name
);
return
GetDims
(
arg_names
);
return
GetDims
(
arg_names
);
...
@@ -46,15 +46,15 @@ void InferShapeContext::SetOutputDim(const std::string &name, const DDim &dim) {
...
@@ -46,15 +46,15 @@ void InferShapeContext::SetOutputDim(const std::string &name, const DDim &dim) {
SetDim
(
arg_names
[
0
],
dim
);
SetDim
(
arg_names
[
0
],
dim
);
}
}
void
InferShapeContext
::
SetOutputsDim
(
void
InferShapeContext
::
SetOutputsDim
(
const
std
::
string
&
name
,
const
std
::
string
&
name
,
const
std
::
vector
<
framework
::
DDim
>
&
dims
)
{
const
std
::
vector
<
DDim
>
&
dims
)
{
auto
&
names
=
Outputs
(
name
);
auto
&
names
=
Outputs
(
name
);
SetDims
(
names
,
dims
);
SetDims
(
names
,
dims
);
}
}
std
::
vector
<
DDim
>
InferShapeContext
::
GetDims
(
std
::
vector
<
DDim
>
InferShapeContext
::
GetDims
(
const
std
::
vector
<
std
::
string
>
&
names
)
const
{
const
std
::
vector
<
std
::
string
>
&
names
)
const
{
std
::
vector
<
framework
::
DDim
>
ret
;
std
::
vector
<
DDim
>
ret
;
ret
.
reserve
(
names
.
size
());
ret
.
reserve
(
names
.
size
());
std
::
transform
(
std
::
transform
(
names
.
begin
(),
names
.
end
(),
std
::
back_inserter
(
ret
),
names
.
begin
(),
names
.
end
(),
std
::
back_inserter
(
ret
),
...
@@ -62,7 +62,7 @@ std::vector<DDim> InferShapeContext::GetDims(
...
@@ -62,7 +62,7 @@ std::vector<DDim> InferShapeContext::GetDims(
return
ret
;
return
ret
;
}
}
void
InferShapeContext
::
SetDims
(
const
std
::
vector
<
std
::
string
>
&
names
,
void
InferShapeContext
::
SetDims
(
const
std
::
vector
<
std
::
string
>
&
names
,
const
std
::
vector
<
framework
::
DDim
>
&
dims
)
{
const
std
::
vector
<
DDim
>
&
dims
)
{
size_t
length
=
names
.
size
();
size_t
length
=
names
.
size
();
PADDLE_ENFORCE_EQ
(
length
,
dims
.
size
());
PADDLE_ENFORCE_EQ
(
length
,
dims
.
size
());
for
(
size_t
i
=
0
;
i
<
length
;
++
i
)
{
for
(
size_t
i
=
0
;
i
<
length
;
++
i
)
{
...
...
paddle/framework/shape_inference.h
浏览文件 @
9a970702
...
@@ -35,14 +35,13 @@ class InferShapeContext {
...
@@ -35,14 +35,13 @@ class InferShapeContext {
virtual
bool
HasInputs
(
const
std
::
string
&
name
)
const
=
0
;
virtual
bool
HasInputs
(
const
std
::
string
&
name
)
const
=
0
;
virtual
bool
HasOutputs
(
const
std
::
string
&
name
)
const
=
0
;
virtual
bool
HasOutputs
(
const
std
::
string
&
name
)
const
=
0
;
framework
::
DDim
GetInputDim
(
const
std
::
string
&
name
)
const
;
DDim
GetInputDim
(
const
std
::
string
&
name
)
const
;
std
::
vector
<
framework
::
DDim
>
GetInputsDim
(
const
std
::
string
&
name
)
const
;
std
::
vector
<
DDim
>
GetInputsDim
(
const
std
::
string
&
name
)
const
;
DDim
GetInputsElementDim
(
const
std
::
string
&
name
,
int
idx
)
const
;
DDim
GetInputsElementDim
(
const
std
::
string
&
name
,
int
idx
)
const
;
void
SetOutputDim
(
const
std
::
string
&
name
,
const
DDim
&
dim
);
void
SetOutputDim
(
const
std
::
string
&
name
,
const
DDim
&
dim
);
void
SetOutputsDim
(
const
std
::
string
&
name
,
void
SetOutputsDim
(
const
std
::
string
&
name
,
const
std
::
vector
<
DDim
>
&
dims
);
const
std
::
vector
<
framework
::
DDim
>
&
dims
);
virtual
AttrReader
Attrs
()
const
=
0
;
virtual
AttrReader
Attrs
()
const
=
0
;
virtual
const
std
::
vector
<
std
::
string
>
&
Inputs
(
virtual
const
std
::
vector
<
std
::
string
>
&
Inputs
(
...
@@ -57,11 +56,11 @@ class InferShapeContext {
...
@@ -57,11 +56,11 @@ class InferShapeContext {
// Note: In while op, we need this to be public
// Note: In while op, we need this to be public
void
SetDims
(
const
std
::
vector
<
std
::
string
>
&
names
,
void
SetDims
(
const
std
::
vector
<
std
::
string
>
&
names
,
const
std
::
vector
<
framework
::
DDim
>
&
dims
);
const
std
::
vector
<
DDim
>
&
dims
);
protected:
protected:
virtual
framework
::
DDim
GetDim
(
const
std
::
string
&
name
)
const
=
0
;
virtual
DDim
GetDim
(
const
std
::
string
&
name
)
const
=
0
;
virtual
void
SetDim
(
const
std
::
string
&
name
,
const
framework
::
DDim
&
dim
)
=
0
;
virtual
void
SetDim
(
const
std
::
string
&
name
,
const
DDim
&
dim
)
=
0
;
std
::
vector
<
DDim
>
GetDims
(
const
std
::
vector
<
std
::
string
>
&
names
)
const
;
std
::
vector
<
DDim
>
GetDims
(
const
std
::
vector
<
std
::
string
>
&
names
)
const
;
std
::
vector
<
proto
::
VarDesc
::
VarType
>
GetVarTypes
(
std
::
vector
<
proto
::
VarDesc
::
VarType
>
GetVarTypes
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录