Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
cbbf08ae
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
cbbf08ae
编写于
4月 18, 2018
作者:
A
Abhinav Arora
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fix CPPLint errors in some framework files
上级
c5c7dc2e
变更
19
显示空白变更内容
内联
并排
Showing
19 changed file
with
52 addition
and
27 deletion
+52
-27
paddle/fluid/framework/concurrency_test.cc
paddle/fluid/framework/concurrency_test.cc
+24
-24
paddle/fluid/framework/data_layout.h
paddle/fluid/framework/data_layout.h
+1
-0
paddle/fluid/framework/data_layout_transform.cc
paddle/fluid/framework/data_layout_transform.cc
+1
-0
paddle/fluid/framework/data_layout_transform.h
paddle/fluid/framework/data_layout_transform.h
+1
-0
paddle/fluid/framework/data_type_transform.h
paddle/fluid/framework/data_type_transform.h
+1
-0
paddle/fluid/framework/feed_fetch_method.cc
paddle/fluid/framework/feed_fetch_method.cc
+2
-0
paddle/fluid/framework/feed_fetch_method.h
paddle/fluid/framework/feed_fetch_method.h
+1
-0
paddle/fluid/framework/lod_rank_table.h
paddle/fluid/framework/lod_rank_table.h
+1
-0
paddle/fluid/framework/mixed_vector.h
paddle/fluid/framework/mixed_vector.h
+1
-0
paddle/fluid/framework/op_desc.cc
paddle/fluid/framework/op_desc.cc
+3
-1
paddle/fluid/framework/op_kernel_type.h
paddle/fluid/framework/op_kernel_type.h
+1
-0
paddle/fluid/framework/op_proto_maker.cc
paddle/fluid/framework/op_proto_maker.cc
+1
-0
paddle/fluid/framework/op_proto_maker.h
paddle/fluid/framework/op_proto_maker.h
+1
-0
paddle/fluid/framework/shape_inference.cc
paddle/fluid/framework/shape_inference.cc
+5
-1
paddle/fluid/framework/shape_inference.h
paddle/fluid/framework/shape_inference.h
+2
-0
paddle/fluid/framework/tensor_util.h
paddle/fluid/framework/tensor_util.h
+1
-0
paddle/fluid/framework/var_desc.h
paddle/fluid/framework/var_desc.h
+2
-0
paddle/fluid/framework/var_type_inference_test.cc
paddle/fluid/framework/var_type_inference_test.cc
+1
-0
paddle/fluid/framework/variable.h
paddle/fluid/framework/variable.h
+2
-1
未找到文件。
paddle/fluid/framework/concurrency_test.cc
浏览文件 @
cbbf08ae
...
...
@@ -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
limitations under the License. */
#include <thread>
#include <thread>
// NOLINT
#include "gtest/gtest.h"
#include "paddle/fluid/framework/block_desc.h"
...
...
@@ -40,10 +40,10 @@ namespace paddle {
namespace
framework
{
template
<
typename
T
>
LoDTensor
*
CreateVariable
(
Scope
&
scope
,
p
::
CPUPlace
&
place
,
std
::
string
nam
e
,
T
value
)
{
LoDTensor
*
CreateVariable
(
Scope
*
scope
,
const
p
::
CPUPlace
&
plac
e
,
std
::
string
name
,
T
value
)
{
// Create LoDTensor<int> of dim [1]
auto
var
=
scope
.
Var
(
name
);
auto
var
=
scope
->
Var
(
name
);
auto
tensor
=
var
->
GetMutable
<
LoDTensor
>
();
tensor
->
Resize
({
1
});
T
*
expect
=
tensor
->
mutable_data
<
T
>
(
place
);
...
...
@@ -77,9 +77,9 @@ void AddCase(ProgramDesc *program, Scope *scope, p::CPUPlace *place,
BlockDesc
*
caseBlock
=
program
->
AppendBlock
(
*
casesBlock
);
func
(
caseBlock
,
scope
);
CreateVariable
(
*
scope
,
*
place
,
caseCondName
,
false
);
CreateVariable
(
*
scope
,
*
place
,
caseCondXVarName
,
caseId
);
CreateVariable
(
*
scope
,
*
place
,
caseVarName
,
caseId
);
CreateVariable
(
scope
,
*
place
,
caseCondName
,
false
);
CreateVariable
(
scope
,
*
place
,
caseCondXVarName
,
caseId
);
CreateVariable
(
scope
,
*
place
,
caseVarName
,
caseId
);
scope
->
Var
(
"step_scope"
);
...
...
@@ -96,21 +96,21 @@ void AddFibonacciSelect(Scope *scope, p::CPUPlace *place, ProgramDesc *program,
std
::
string
quitChanName
)
{
BlockDesc
*
whileBlock
=
program
->
AppendBlock
(
*
parentBlock
);
CreateVariable
(
*
scope
,
*
place
,
"whileExitCond"
,
true
);
CreateVariable
(
*
scope
,
*
place
,
"caseToExecute"
,
-
1
);
CreateVariable
(
*
scope
,
*
place
,
"case1var"
,
0
);
CreateVariable
(
scope
,
*
place
,
"whileExitCond"
,
true
);
CreateVariable
(
scope
,
*
place
,
"caseToExecute"
,
-
1
);
CreateVariable
(
scope
,
*
place
,
"case1var"
,
0
);
CreateVariable
(
*
scope
,
*
place
,
"xtemp"
,
0
);
CreateVariable
(
scope
,
*
place
,
"xtemp"
,
0
);
// TODO(thuan): Need to create fibXToSend, since channel send moves the actual
// data,
// which causes the data to be no longer accessible to do the fib calculation
// TODO(abhinav): Change channel send to do a copy instead of a move!
CreateVariable
(
*
scope
,
*
place
,
"fibXToSend"
,
0
);
CreateVariable
(
scope
,
*
place
,
"fibXToSend"
,
0
);
CreateVariable
(
*
scope
,
*
place
,
"fibX"
,
0
);
CreateVariable
(
*
scope
,
*
place
,
"fibY"
,
1
);
CreateVariable
(
*
scope
,
*
place
,
"quitVar"
,
0
);
CreateVariable
(
scope
,
*
place
,
"fibX"
,
0
);
CreateVariable
(
scope
,
*
place
,
"fibY"
,
1
);
CreateVariable
(
scope
,
*
place
,
"quitVar"
,
0
);
BlockDesc
*
casesBlock
=
program
->
AppendBlock
(
*
whileBlock
);
std
::
function
<
void
(
BlockDesc
*
caseBlock
)
>
f
=
[](
BlockDesc
*
caseBlock
)
{};
...
...
@@ -138,7 +138,7 @@ void AddFibonacciSelect(Scope *scope, p::CPUPlace *place, ProgramDesc *program,
// Exit the while loop after we receive from quit channel.
// We assign a false to "whileExitCond" variable, which will
// break out of while_op loop
CreateVariable
(
*
scope
,
*
place
,
"whileFalse"
,
false
);
CreateVariable
(
scope
,
*
place
,
"whileFalse"
,
false
);
AddOp
(
"assign"
,
{{
"X"
,
{
"whileFalse"
}}},
{{
"Out"
,
{
"whileExitCond"
}}},
{},
caseBlock
);
};
...
...
@@ -174,9 +174,9 @@ TEST(Concurrency, Go_Op) {
// Create Variables, x0 will be put into channel,
// result will be pulled from channel
CreateVariable
(
scope
,
place
,
"Status"
,
false
);
CreateVariable
(
scope
,
place
,
"x0"
,
99
);
CreateVariable
(
scope
,
place
,
"result"
,
0
);
CreateVariable
(
&
scope
,
place
,
"Status"
,
false
);
CreateVariable
(
&
scope
,
place
,
"x0"
,
99
);
CreateVariable
(
&
scope
,
place
,
"result"
,
0
);
framework
::
Executor
executor
(
place
);
ProgramDesc
program
;
...
...
@@ -226,9 +226,9 @@ TEST(Concurrency, Select) {
// Initialize scope variables
p
::
CPUDeviceContext
ctx
(
place
);
CreateVariable
(
scope
,
place
,
"Status"
,
false
);
CreateVariable
(
scope
,
place
,
"result"
,
0
);
CreateVariable
(
scope
,
place
,
"currentXFib"
,
0
);
CreateVariable
(
&
scope
,
place
,
"Status"
,
false
);
CreateVariable
(
&
scope
,
place
,
"result"
,
0
);
CreateVariable
(
&
scope
,
place
,
"currentXFib"
,
0
);
framework
::
Executor
executor
(
place
);
ProgramDesc
program
;
...
...
@@ -246,7 +246,7 @@ TEST(Concurrency, Select) {
{{
"capacity"
,
0
},
{
"data_type"
,
f
::
proto
::
VarType
::
LOD_TENSOR
}},
block
);
// Create Go Op routine, which loops 10 times over fibonacci sequence
CreateVariable
(
scope
,
place
,
"xReceiveVar"
,
0
);
CreateVariable
(
&
scope
,
place
,
"xReceiveVar"
,
0
);
BlockDesc
*
goOpBlock
=
program
.
AppendBlock
(
program
.
Block
(
0
));
for
(
int
i
=
0
;
i
<
10
;
++
i
)
{
...
...
@@ -264,7 +264,7 @@ TEST(Concurrency, Select) {
goOpBlock
);
}
CreateVariable
(
scope
,
place
,
"quitSignal"
,
0
);
CreateVariable
(
&
scope
,
place
,
"quitSignal"
,
0
);
AddOp
(
"channel_send"
,
{{
"Channel"
,
{
quitChanName
}},
{
"X"
,
{
"quitSignal"
}}},
{{
"Status"
,
{
"Status"
}}},
{},
goOpBlock
);
...
...
paddle/fluid/framework/data_layout.h
浏览文件 @
cbbf08ae
...
...
@@ -16,6 +16,7 @@ limitations under the License. */
#include <cctype>
#include <ostream>
#include <string>
#include "paddle/fluid/platform/enforce.h"
...
...
paddle/fluid/framework/data_layout_transform.cc
浏览文件 @
cbbf08ae
...
...
@@ -13,6 +13,7 @@
// limitations under the License.
#include "paddle/fluid/framework/data_layout_transform.h"
#include <vector>
#include "paddle/fluid/operators/math/math_function.h"
...
...
paddle/fluid/framework/data_layout_transform.h
浏览文件 @
cbbf08ae
...
...
@@ -14,6 +14,7 @@
#pragma once
#include <vector>
#include "paddle/fluid/framework/op_kernel_type.h"
#include "paddle/fluid/framework/tensor.h"
#include "paddle/fluid/framework/variable.h"
...
...
paddle/fluid/framework/data_type_transform.h
浏览文件 @
cbbf08ae
...
...
@@ -14,6 +14,7 @@ limitations under the License. */
#pragma once
#include <utility>
#include "paddle/fluid/framework/op_kernel_type.h"
#include "paddle/fluid/framework/tensor.h"
#include "paddle/fluid/framework/variable.h"
...
...
paddle/fluid/framework/feed_fetch_method.cc
浏览文件 @
cbbf08ae
...
...
@@ -13,6 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/framework/feed_fetch_method.h"
#include <string>
#include <vector>
#include "glog/logging.h"
#include "paddle/fluid/framework/variable.h"
...
...
paddle/fluid/framework/feed_fetch_method.h
浏览文件 @
cbbf08ae
...
...
@@ -14,6 +14,7 @@ limitations under the License. */
#pragma once
#include <string>
#include "paddle/fluid/framework/feed_fetch_type.h"
#include "paddle/fluid/framework/scope.h"
...
...
paddle/fluid/framework/lod_rank_table.h
浏览文件 @
cbbf08ae
...
...
@@ -14,6 +14,7 @@ limitations under the License. */
#pragma once
#include <iosfwd>
#include <vector>
#include "paddle/fluid/framework/lod_tensor.h"
namespace
paddle
{
...
...
paddle/fluid/framework/mixed_vector.h
浏览文件 @
cbbf08ae
...
...
@@ -14,6 +14,7 @@
#pragma once
#include <algorithm>
#include <initializer_list>
#include <vector>
...
...
paddle/fluid/framework/op_desc.cc
浏览文件 @
cbbf08ae
...
...
@@ -13,8 +13,10 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/framework/op_desc.h"
#include <algorithm>
#include <functional>
#include <mutex>
#include <mutex> // NOLINT
#include <string>
#include <unordered_map>
#include "glog/logging.h"
#include "paddle/fluid/framework/block_desc.h"
...
...
paddle/fluid/framework/op_kernel_type.h
浏览文件 @
cbbf08ae
...
...
@@ -14,6 +14,7 @@ limitations under the License. */
#pragma once
#include <string>
#include "paddle/fluid/framework/data_layout.h"
#include "paddle/fluid/framework/data_type.h"
#include "paddle/fluid/framework/library_type.h"
...
...
paddle/fluid/framework/op_proto_maker.cc
浏览文件 @
cbbf08ae
...
...
@@ -12,6 +12,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/framework/op_proto_maker.h"
#include <string>
namespace
paddle
{
namespace
framework
{
...
...
paddle/fluid/framework/op_proto_maker.h
浏览文件 @
cbbf08ae
...
...
@@ -13,6 +13,7 @@ limitations under the License. */
#pragma once
#include <string>
#include "paddle/fluid/framework/attribute.h"
#include "paddle/fluid/framework/framework.pb.h"
...
...
paddle/fluid/framework/shape_inference.cc
浏览文件 @
cbbf08ae
...
...
@@ -11,8 +11,12 @@ 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. */
#include "paddle/fluid/framework/shape_inference.h"
#include "grad_op_desc_maker.h"
#include <algorithm>
#include <string>
#include <vector>
#include "paddle/fluid/framework/grad_op_desc_maker.h"
#include "paddle/fluid/framework/operator.h"
namespace
paddle
{
...
...
paddle/fluid/framework/shape_inference.h
浏览文件 @
cbbf08ae
...
...
@@ -14,6 +14,8 @@ limitations under the License. */
#pragma once
#include <string>
#include <vector>
#include "paddle/fluid/framework/attribute.h"
#include "paddle/fluid/framework/ddim.h"
#include "paddle/fluid/framework/framework.pb.h"
...
...
paddle/fluid/framework/tensor_util.h
浏览文件 @
cbbf08ae
...
...
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#pragma once
#include <vector>
#include "paddle/fluid/framework/data_type.h"
#include "paddle/fluid/framework/eigen.h"
#include "paddle/fluid/framework/framework.pb.h"
...
...
paddle/fluid/framework/var_desc.h
浏览文件 @
cbbf08ae
...
...
@@ -14,6 +14,8 @@ limitations under the License. */
#pragma once
#include <algorithm>
#include <string>
#include <vector>
#include "glog/logging.h"
#include "paddle/fluid/framework/framework.pb.h"
...
...
paddle/fluid/framework/var_type_inference_test.cc
浏览文件 @
cbbf08ae
...
...
@@ -13,6 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License. */
#include "paddle/fluid/framework/var_type_inference.h"
#include <string>
#include "gtest/gtest.h"
#include "paddle/fluid/framework/op_registry.h"
#include "paddle/fluid/framework/operator.h"
...
...
paddle/fluid/framework/variable.h
浏览文件 @
cbbf08ae
...
...
@@ -14,6 +14,7 @@
#pragma once
#include <memory>
#include <string>
#include <typeindex>
#include <typeinfo>
...
...
@@ -67,7 +68,7 @@ class Variable {
// parameter of Variable.
template
<
typename
T
>
struct
PlaceholderImpl
:
public
Placeholder
{
PlaceholderImpl
(
T
*
ptr
)
:
ptr_
(
ptr
),
type_
(
typeid
(
T
))
{}
explicit
PlaceholderImpl
(
T
*
ptr
)
:
ptr_
(
ptr
),
type_
(
typeid
(
T
))
{}
virtual
const
std
::
type_info
&
Type
()
const
{
return
type_
;
}
virtual
void
*
Ptr
()
const
{
return
static_cast
<
void
*>
(
ptr_
.
get
());
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录