Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
19972fd3
M
mindspore
项目概览
magicwindyyd
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindspore
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
19972fd3
编写于
5月 07, 2020
作者:
V
VectorSL
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update conv2d_bprop init
上级
e03359cc
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
24 deletion
+14
-24
mindspore/ccsrc/kernel/gpu/nn/conv2d_grad_filter_gpu_kernel.h
...spore/ccsrc/kernel/gpu/nn/conv2d_grad_filter_gpu_kernel.h
+5
-9
mindspore/ccsrc/kernel/gpu/nn/conv2d_grad_input_gpu_kernel.h
mindspore/ccsrc/kernel/gpu/nn/conv2d_grad_input_gpu_kernel.h
+9
-15
未找到文件。
mindspore/ccsrc/kernel/gpu/nn/conv2d_grad_filter_gpu_kernel.h
浏览文件 @
19972fd3
...
@@ -49,6 +49,7 @@ class ConvGradFilterGpuBkwKernel : public GpuKernel {
...
@@ -49,6 +49,7 @@ class ConvGradFilterGpuBkwKernel : public GpuKernel {
group_
(
1
),
group_
(
1
),
is_null_input_
(
false
),
is_null_input_
(
false
),
input_size_
(
0
),
input_size_
(
0
),
dy_size_
(
0
),
output_size_
(
0
),
output_size_
(
0
),
padded_size_
(
0
),
padded_size_
(
0
),
workspace_size_
(
0
),
workspace_size_
(
0
),
...
@@ -152,22 +153,16 @@ class ConvGradFilterGpuBkwKernel : public GpuKernel {
...
@@ -152,22 +153,16 @@ class ConvGradFilterGpuBkwKernel : public GpuKernel {
}
}
void
InitSizeLists
()
override
{
void
InitSizeLists
()
override
{
if
(
!
is_null_input_
)
{
if
(
!
is_null_input_
)
{
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetTensorSizeInBytes
(
dy_desc_
,
reinterpret_cast
<
size_t
*>
(
&
input
_size_
)),
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetTensorSizeInBytes
(
dy_desc_
,
reinterpret_cast
<
size_t
*>
(
&
dy
_size_
)),
"cudnnGetTensorSizeInBytes failed"
);
"cudnnGetTensorSizeInBytes failed"
);
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetFilterSizeInBytes
(
dw_desc_
,
reinterpret_cast
<
size_t
*>
(
&
output_size_
)),
"cudnnGetFilterSizeInBytes failed"
);
}
input_size_list_
.
push_back
(
input_size_
);
output_size_list_
.
push_back
(
output_size_
);
if
(
!
is_null_input_
)
{
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetTensorSizeInBytes
(
x_desc_
,
reinterpret_cast
<
size_t
*>
(
&
input_size_
)),
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetTensorSizeInBytes
(
x_desc_
,
reinterpret_cast
<
size_t
*>
(
&
input_size_
)),
"cudnnGetTensorSizeInBytes failed"
);
"cudnnGetTensorSizeInBytes failed"
);
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetFilterSizeInBytes
(
dw_desc_
,
reinterpret_cast
<
size_t
*>
(
&
output_size_
)),
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetFilterSizeInBytes
(
dw_desc_
,
reinterpret_cast
<
size_t
*>
(
&
output_size_
)),
"cudnnGetFilterSizeInBytes failed"
);
"cudnnGetFilterSizeInBytes failed"
);
}
}
input_size_list_
.
push_back
(
dy_size_
);
input_size_list_
.
push_back
(
input_size_
);
input_size_list_
.
push_back
(
input_size_
);
in
put_size_list_
.
push_back
(
output_size_
);
out
put_size_list_
.
push_back
(
output_size_
);
if
((
pad_mode_
==
kSamePadModeUpperCase
||
pad_mode_
==
kSamePadModeLowerCase
)
&&
use_pad_
&&
!
is_null_input_
)
{
if
((
pad_mode_
==
kSamePadModeUpperCase
||
pad_mode_
==
kSamePadModeLowerCase
)
&&
use_pad_
&&
!
is_null_input_
)
{
CHECK_CUDNN_RET_WITH_EXCEPT
(
CHECK_CUDNN_RET_WITH_EXCEPT
(
...
@@ -313,6 +308,7 @@ class ConvGradFilterGpuBkwKernel : public GpuKernel {
...
@@ -313,6 +308,7 @@ class ConvGradFilterGpuBkwKernel : public GpuKernel {
int
group_
;
int
group_
;
bool
is_null_input_
;
bool
is_null_input_
;
size_t
input_size_
;
size_t
input_size_
;
size_t
dy_size_
;
size_t
output_size_
;
size_t
output_size_
;
size_t
padded_size_
;
size_t
padded_size_
;
size_t
workspace_size_
;
size_t
workspace_size_
;
...
...
mindspore/ccsrc/kernel/gpu/nn/conv2d_grad_input_gpu_kernel.h
浏览文件 @
19972fd3
...
@@ -48,7 +48,8 @@ class ConvGradInputGpuBkwKernel : public GpuKernel {
...
@@ -48,7 +48,8 @@ class ConvGradInputGpuBkwKernel : public GpuKernel {
c_
(
0
),
c_
(
0
),
group_
(
1
),
group_
(
1
),
is_null_input_
(
false
),
is_null_input_
(
false
),
input_size_
(
0
),
dy_size_
(
0
),
w_size_
(
0
),
output_size_
(
0
),
output_size_
(
0
),
padded_size_
(
0
),
padded_size_
(
0
),
workspace_size_
(
0
),
workspace_size_
(
0
),
...
@@ -82,7 +83,7 @@ class ConvGradInputGpuBkwKernel : public GpuKernel {
...
@@ -82,7 +83,7 @@ class ConvGradInputGpuBkwKernel : public GpuKernel {
cudnnConvolutionBackwardData
(
cudnn_handle_
,
&
alpha
,
w_desc_
,
w
,
dy_desc_
,
dy
,
conv_desc_
,
algo_
,
work_space
,
cudnnConvolutionBackwardData
(
cudnn_handle_
,
&
alpha
,
w_desc_
,
w
,
dy_desc_
,
dy
,
conv_desc_
,
algo_
,
work_space
,
workspace_size_
,
&
beta
,
padded_descriptor_
,
padded
),
workspace_size_
,
&
beta
,
padded_descriptor_
,
padded
),
"ConvolutionBackwardData failed"
);
"ConvolutionBackwardData failed"
);
CalPadGrad
(
in
put_size_
/
sizeof
(
T
),
padded
,
n_
,
c_
,
old_height_
,
old_width_
,
old_height_
+
pad_height_
,
CalPadGrad
(
out
put_size_
/
sizeof
(
T
),
padded
,
n_
,
c_
,
old_height_
,
old_width_
,
old_height_
+
pad_height_
,
old_width_
+
pad_width_
,
pad_top_
,
pad_left_
,
dx
,
reinterpret_cast
<
cudaStream_t
>
(
stream_ptr
));
old_width_
+
pad_width_
,
pad_top_
,
pad_left_
,
dx
,
reinterpret_cast
<
cudaStream_t
>
(
stream_ptr
));
}
else
{
}
else
{
CHECK_CUDNN_RET_WITH_EXCEPT
(
CHECK_CUDNN_RET_WITH_EXCEPT
(
...
@@ -153,23 +154,15 @@ class ConvGradInputGpuBkwKernel : public GpuKernel {
...
@@ -153,23 +154,15 @@ class ConvGradInputGpuBkwKernel : public GpuKernel {
}
}
void
InitSizeLists
()
override
{
void
InitSizeLists
()
override
{
if
(
!
is_null_input_
)
{
if
(
!
is_null_input_
)
{
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetTensorSizeInBytes
(
dy_desc_
,
&
input_size_
),
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetTensorSizeInBytes
(
dy_desc_
,
&
dy_size_
),
"cudnnGetTensorSizeInBytes failed"
);
"cudnnGetTensorSizeInBytes failed"
);
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetFilterSizeInBytes
(
w_desc_
,
&
w_size_
),
"cudnnGetTensorSizeInBytes failed"
);
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetTensorSizeInBytes
(
dx_desc_
,
&
output_size_
),
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetTensorSizeInBytes
(
dx_desc_
,
&
output_size_
),
"cudnnGetTensorSizeInBytes failed"
);
"cudnnGetTensorSizeInBytes failed"
);
}
}
input_size_list_
.
push_back
(
input_size_
);
input_size_list_
.
push_back
(
dy_size_
);
input_size_list_
.
push_back
(
w_size_
);
output_size_list_
.
push_back
(
output_size_
);
output_size_list_
.
push_back
(
output_size_
);
if
(
!
is_null_input_
)
{
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetTensorSizeInBytes
(
dx_desc_
,
&
input_size_
),
"cudnnGetTensorSizeInBytes failed"
);
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetFilterSizeInBytes
(
w_desc_
,
&
output_size_
),
"cudnnGetTensorSizeInBytes failed"
);
}
input_size_list_
.
push_back
(
input_size_
);
input_size_list_
.
push_back
(
output_size_
);
if
((
pad_mode_
==
kSamePadModeUpperCase
||
pad_mode_
==
kSamePadModeLowerCase
)
&&
use_pad_
&&
!
is_null_input_
)
{
if
((
pad_mode_
==
kSamePadModeUpperCase
||
pad_mode_
==
kSamePadModeLowerCase
)
&&
use_pad_
&&
!
is_null_input_
)
{
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetTensorSizeInBytes
(
padded_descriptor_
,
&
padded_size_
),
CHECK_CUDNN_RET_WITH_EXCEPT
(
cudnnGetTensorSizeInBytes
(
padded_descriptor_
,
&
padded_size_
),
"cudnnGetTensorSizeInBytes failed"
);
"cudnnGetTensorSizeInBytes failed"
);
...
@@ -309,7 +302,8 @@ class ConvGradInputGpuBkwKernel : public GpuKernel {
...
@@ -309,7 +302,8 @@ class ConvGradInputGpuBkwKernel : public GpuKernel {
std
::
vector
<
int
>
dilation_
;
std
::
vector
<
int
>
dilation_
;
int
group_
;
int
group_
;
bool
is_null_input_
;
bool
is_null_input_
;
size_t
input_size_
;
size_t
dy_size_
;
size_t
w_size_
;
size_t
output_size_
;
size_t
output_size_
;
size_t
padded_size_
;
size_t
padded_size_
;
size_t
workspace_size_
;
size_t
workspace_size_
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录