Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
BaiXuePrincess
Paddle
提交
5017b154
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看板
提交
5017b154
编写于
7月 17, 2017
作者:
Q
qijun
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor tensor mutable_data
上级
65dbeb6a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
19 addition
and
21 deletion
+19
-21
paddle/framework/operator.h
paddle/framework/operator.h
+7
-7
paddle/framework/tensor.h
paddle/framework/tensor.h
+10
-12
paddle/platform/device_context.h
paddle/platform/device_context.h
+2
-2
未找到文件。
paddle/framework/operator.h
浏览文件 @
5017b154
...
@@ -14,17 +14,17 @@ limitations under the License. */
...
@@ -14,17 +14,17 @@ limitations under the License. */
#pragma once
#pragma once
#include <paddle/framework/attr_checker.h>
#include <paddle/framework/op_desc.pb.h>
#include <paddle/framework/scope.h>
#include <paddle/framework/tensor.h>
#include <paddle/platform/device_context.h>
#include <paddle/platform/place.h>
#include <paddle/utils/Error.h>
#include <boost/variant.hpp>
#include <boost/variant.hpp>
#include <string>
#include <string>
#include <unordered_map>
#include <unordered_map>
#include <vector>
#include <vector>
#include "paddle/framework/attr_checker.h"
#include "paddle/framework/op_desc.pb.h"
#include "paddle/framework/scope.h"
#include "paddle/framework/tensor.h"
#include "paddle/platform/device_context.h"
#include "paddle/platform/place.h"
#include "paddle/utils/Error.h"
namespace
paddle
{
namespace
paddle
{
namespace
framework
{
namespace
framework
{
...
...
paddle/framework/tensor.h
浏览文件 @
5017b154
...
@@ -62,21 +62,19 @@ class Tensor {
...
@@ -62,21 +62,19 @@ class Tensor {
!
(
holder_
->
place
()
==
!
(
holder_
->
place
()
==
place
)
/* some versions of boost::variant don't have operator!= */
place
)
/* some versions of boost::variant don't have operator!= */
||
holder_
->
size
()
<
numel_
*
sizeof
(
T
)
+
offset_
)
{
||
holder_
->
size
()
<
numel_
*
sizeof
(
T
)
+
offset_
)
{
if
(
platform
::
is_cpu_place
(
place
))
{
holder_
.
reset
(
new
PlaceholderImpl
<
T
,
platform
::
CPUPlace
>
(
boost
::
get
<
platform
::
CPUPlace
>
(
place
),
numel_
*
sizeof
(
T
)));
}
#ifdef __CUDACC__
#ifdef __CUDACC__
switch
(
place
.
which
())
{
else
if
(
platform
::
is_gpu_place
(
place
))
{
case
0
:
holder_
.
reset
(
new
PlaceholderImpl
<
T
,
platform
::
GPUPlace
>
(
holder_
.
reset
(
new
PlaceholderImpl
<
T
,
platform
::
GPUPlace
>
(
boost
::
get
<
platform
::
GPUPlace
>
(
place
),
numel_
*
sizeof
(
T
)));
boost
::
get
<
platform
::
GPUPlace
>
(
place
),
numel_
*
sizeof
(
T
)));
break
;
case
1
:
holder_
.
reset
(
new
PlaceholderImpl
<
T
,
platform
::
CPUPlace
>
(
boost
::
get
<
platform
::
CPUPlace
>
(
place
),
numel_
*
sizeof
(
T
)));
break
;
}
}
#else
#else
holder_
.
reset
(
new
PlaceholderImpl
<
T
,
platform
::
CPUPlace
>
(
else
if
(
platform
::
is_gpu_place
(
place
))
{
boost
::
get
<
platform
::
CPUPlace
>
(
place
),
numel_
*
sizeof
(
T
)));
PADDLE_ENFORCE
(
true
,
"GPU not support!"
);
}
#endif
#endif
offset_
=
0
;
offset_
=
0
;
}
}
...
...
paddle/platform/device_context.h
浏览文件 @
5017b154
...
@@ -20,9 +20,9 @@ limitations under the License. */
...
@@ -20,9 +20,9 @@ limitations under the License. */
#include "paddle/platform/gpu_info.h"
#include "paddle/platform/gpu_info.h"
#define EIGEN_USE_GPU
#define EIGEN_USE_GPU
#endif
#endif
#include <paddle/platform/place.h>
#include <memory>
#include <memory>
#include <unsupported/Eigen/CXX11/Tensor>
#include "paddle/platform/place.h"
#include "unsupported/Eigen/CXX11/Tensor"
namespace
paddle
{
namespace
paddle
{
namespace
platform
{
namespace
platform
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录