Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
251c6032
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看板
提交
251c6032
编写于
1月 15, 2018
作者:
C
chengduoZH
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
set use_cudnn as default
上级
79aa5122
变更
9
显示空白变更内容
内联
并排
Showing
9 changed file
with
24 addition
and
19 deletion
+24
-19
paddle/operators/conv_op.cc
paddle/operators/conv_op.cc
+6
-2
paddle/operators/conv_op.h
paddle/operators/conv_op.h
+0
-1
paddle/operators/conv_transpose_op.cc
paddle/operators/conv_transpose_op.cc
+6
-2
paddle/operators/conv_transpose_op.h
paddle/operators/conv_transpose_op.h
+0
-1
paddle/operators/pool_op.cc
paddle/operators/pool_op.cc
+6
-2
paddle/operators/pool_op.h
paddle/operators/pool_op.h
+0
-1
paddle/platform/dynload/cudnn.cc
paddle/platform/dynload/cudnn.cc
+0
-4
python/paddle/v2/fluid/layers/nn.py
python/paddle/v2/fluid/layers/nn.py
+3
-3
python/paddle/v2/fluid/nets.py
python/paddle/v2/fluid/nets.py
+3
-3
未找到文件。
paddle/operators/conv_op.cc
浏览文件 @
251c6032
...
...
@@ -70,7 +70,9 @@ void ConvOp::InferShape(framework::InferShapeContext* ctx) const {
framework
::
OpKernelType
ConvOp
::
GetExpectedKernelType
(
const
framework
::
ExecutionContext
&
ctx
)
const
{
bool
use_cudnn
=
ctx
.
Attr
<
bool
>
(
"use_cudnn"
);
use_cudnn
&=
platform
::
dynload
::
HasCUDNN
();
if
(
paddle
::
platform
::
is_cpu_place
(
ctx
.
GetPlace
()))
{
use_cudnn
=
false
;
}
framework
::
LibraryType
library_
;
if
(
use_cudnn
)
{
library_
=
framework
::
LibraryType
::
kCUDNN
;
...
...
@@ -284,7 +286,9 @@ void ConvOpGrad::InferShape(framework::InferShapeContext* ctx) const {
framework
::
OpKernelType
ConvOpGrad
::
GetExpectedKernelType
(
const
framework
::
ExecutionContext
&
ctx
)
const
{
bool
use_cudnn
=
ctx
.
Attr
<
bool
>
(
"use_cudnn"
);
use_cudnn
&=
platform
::
dynload
::
HasCUDNN
();
if
(
paddle
::
platform
::
is_cpu_place
(
ctx
.
GetPlace
()))
{
use_cudnn
=
false
;
}
framework
::
LibraryType
library_
;
if
(
use_cudnn
)
{
library_
=
framework
::
LibraryType
::
kCUDNN
;
...
...
paddle/operators/conv_op.h
浏览文件 @
251c6032
...
...
@@ -19,7 +19,6 @@ limitations under the License. */
#include "paddle/operators/math/im2col.h"
#include "paddle/operators/math/math_function.h"
#include "paddle/operators/math/vol2col.h"
#include "paddle/platform/dynload/cudnn.h"
namespace
paddle
{
namespace
operators
{
...
...
paddle/operators/conv_transpose_op.cc
浏览文件 @
251c6032
...
...
@@ -61,7 +61,9 @@ void ConvTransposeOp::InferShape(framework::InferShapeContext* ctx) const {
framework
::
OpKernelType
ConvTransposeOp
::
GetExpectedKernelType
(
const
framework
::
ExecutionContext
&
ctx
)
const
{
bool
use_cudnn
=
ctx
.
Attr
<
bool
>
(
"use_cudnn"
);
use_cudnn
&=
platform
::
dynload
::
HasCUDNN
();
if
(
paddle
::
platform
::
is_cpu_place
(
ctx
.
GetPlace
()))
{
use_cudnn
=
false
;
}
framework
::
LibraryType
library_
;
if
(
use_cudnn
)
{
library_
=
framework
::
LibraryType
::
kCUDNN
;
...
...
@@ -264,7 +266,9 @@ void ConvTransposeOpGrad::InferShape(framework::InferShapeContext* ctx) const {
framework
::
OpKernelType
ConvTransposeOpGrad
::
GetExpectedKernelType
(
const
framework
::
ExecutionContext
&
ctx
)
const
{
bool
use_cudnn
=
ctx
.
Attr
<
bool
>
(
"use_cudnn"
);
use_cudnn
&=
platform
::
dynload
::
HasCUDNN
();
if
(
paddle
::
platform
::
is_cpu_place
(
ctx
.
GetPlace
()))
{
use_cudnn
=
false
;
}
framework
::
LibraryType
library_
;
if
(
use_cudnn
)
{
library_
=
framework
::
LibraryType
::
kCUDNN
;
...
...
paddle/operators/conv_transpose_op.h
浏览文件 @
251c6032
...
...
@@ -19,7 +19,6 @@ limitations under the License. */
#include "paddle/operators/math/im2col.h"
#include "paddle/operators/math/math_function.h"
#include "paddle/operators/math/vol2col.h"
#include "paddle/platform/dynload/cudnn.h"
namespace
paddle
{
namespace
operators
{
...
...
paddle/operators/pool_op.cc
浏览文件 @
251c6032
...
...
@@ -64,7 +64,9 @@ void PoolOp::InferShape(framework::InferShapeContext *ctx) const {
framework
::
OpKernelType
PoolOp
::
GetExpectedKernelType
(
const
framework
::
ExecutionContext
&
ctx
)
const
{
bool
use_cudnn
=
ctx
.
Attr
<
bool
>
(
"use_cudnn"
);
use_cudnn
&=
platform
::
dynload
::
HasCUDNN
();
if
(
paddle
::
platform
::
is_cpu_place
(
ctx
.
GetPlace
()))
{
use_cudnn
=
false
;
}
framework
::
LibraryType
library_
;
if
(
use_cudnn
)
{
library_
=
framework
::
LibraryType
::
kCUDNN
;
...
...
@@ -89,7 +91,9 @@ void PoolOpGrad::InferShape(framework::InferShapeContext *ctx) const {
framework
::
OpKernelType
PoolOpGrad
::
GetExpectedKernelType
(
const
framework
::
ExecutionContext
&
ctx
)
const
{
bool
use_cudnn
=
ctx
.
Attr
<
bool
>
(
"use_cudnn"
);
use_cudnn
&=
platform
::
dynload
::
HasCUDNN
();
if
(
paddle
::
platform
::
is_cpu_place
(
ctx
.
GetPlace
()))
{
use_cudnn
=
false
;
}
framework
::
LibraryType
library_
;
if
(
use_cudnn
)
{
library_
=
framework
::
LibraryType
::
kCUDNN
;
...
...
paddle/operators/pool_op.h
浏览文件 @
251c6032
...
...
@@ -18,7 +18,6 @@ limitations under the License. */
#include "paddle/framework/op_registry.h"
#include "paddle/operators/math/math_function.h"
#include "paddle/operators/math/pooling.h"
#include "paddle/platform/dynload/cudnn.h"
namespace
paddle
{
namespace
operators
{
...
...
paddle/platform/dynload/cudnn.cc
浏览文件 @
251c6032
...
...
@@ -57,10 +57,6 @@ void EnforceCUDNNLoaded(const char* fn_name) {
bool
HasCUDNN
()
{
return
true
;
}
#endif
#ifndef PADDLE_WITH_CUDA
bool
HasCUDNN
()
{
return
false
;
}
#endif
}
// namespace dynload
}
// namespace platform
}
// namespace paddle
python/paddle/v2/fluid/layers/nn.py
浏览文件 @
251c6032
...
...
@@ -660,7 +660,7 @@ def conv2d(input,
groups
=
None
,
param_attr
=
None
,
bias_attr
=
None
,
use_cudnn
=
Fals
e
,
use_cudnn
=
Tru
e
,
act
=
None
):
"""
**Convlution2D Layer**
...
...
@@ -938,7 +938,7 @@ def pool2d(input,
pool_stride
=
None
,
pool_padding
=
None
,
global_pooling
=
False
,
use_cudnn
=
Fals
e
):
use_cudnn
=
Tru
e
):
"""
This function adds the operator for pooling in 2 dimensions, using the
pooling configurations mentioned in input parameters.
...
...
@@ -1088,7 +1088,7 @@ def conv2d_transpose(input,
stride
=
None
,
dilation
=
None
,
param_attr
=
None
,
use_cudnn
=
Fals
e
):
use_cudnn
=
Tru
e
):
"""
The transpose of conv2d layer.
...
...
python/paddle/v2/fluid/nets.py
浏览文件 @
251c6032
...
...
@@ -14,7 +14,7 @@ def simple_img_conv_pool(input,
act
,
param_attr
=
None
,
pool_type
=
'max'
,
use_cudnn
=
Fals
e
):
use_cudnn
=
Tru
e
):
conv_out
=
layers
.
conv2d
(
input
=
input
,
num_filters
=
num_filters
,
...
...
@@ -41,10 +41,10 @@ def img_conv_group(input,
param_attr
=
None
,
conv_with_batchnorm
=
False
,
conv_batchnorm_drop_rate
=
None
,
conv_use_cudnn
=
Fals
e
,
conv_use_cudnn
=
Tru
e
,
pool_stride
=
1
,
pool_type
=
None
,
pool_use_cudnn
=
Fals
e
):
pool_use_cudnn
=
Tru
e
):
"""
Image Convolution Group, Used for vgg net.
"""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录