Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
Mace
提交
3f8fa54b
Mace
项目概览
慢慢CG
/
Mace
与 Fork 源项目一致
Fork自
Xiaomi / Mace
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mace
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
3f8fa54b
编写于
11月 08, 2017
作者:
L
liuqi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add todo at mapping guard and format some code.
上级
affce29b
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
6 addition
and
3 deletion
+6
-3
mace/kernels/opencl/cl/space_to_batch.cl
mace/kernels/opencl/cl/space_to_batch.cl
+5
-3
mace/ops/batch_to_space.h
mace/ops/batch_to_space.h
+1
-0
未找到文件。
mace/kernels/opencl/cl/space_to_batch.cl
浏览文件 @
3f8fa54b
void
kernel
space_to_batch
(
global
float
*
space_data_ptr,
void
kernel
space_to_batch
(
global
float
*
space_data_ptr,
global
const
int
*
block_shape_ptr,
global
const
int
*
block_shape_ptr,
global
const
int
*
paddings_ptr,
global
const
int
*
paddings_ptr,
private
const
int
space_batch,
private
const
int
space_batch,
private
const
int
space_channel,
private
const
int
space_channel,
private
const
int
space_height,
private
const
int
space_height,
...
@@ -28,10 +28,12 @@ void kernel space_to_batch(global float* space_data_ptr,
...
@@ -28,10 +28,12 @@ void kernel space_to_batch(global float* space_data_ptr,
batch_pixel_height_idx
*
block_height
;
batch_pixel_height_idx
*
block_height
;
int
space_pixel_width_idx
=
(
remaining_batch_idx
%
block_width
)
+
int
space_pixel_width_idx
=
(
remaining_batch_idx
%
block_width
)
+
batch_pixel_width_idx
*
block_width
;
batch_pixel_width_idx
*
block_width
;
const
int
batch_data_offset
=
batch_idx
*
(
space_channel
*
batch_height
*
batch_width
)
+
const
int
batch_data_offset
=
batch_idx
*
(
space_channel
*
batch_height
*
batch_width
)
+
(
batch_channel_idx
*
batch_height
*
batch_width
)
+
(
batch_channel_idx
*
batch_height
*
batch_width
)
+
batch_pixel_height_idx
*
batch_width
+
batch_pixel_height_idx
*
batch_width
+
batch_pixel_width_idx
;
batch_pixel_width_idx
;
space_pixel_height_idx
-=
padding_height_start
;
space_pixel_height_idx
-=
padding_height_start
;
space_pixel_width_idx
-=
padding_width_start
;
space_pixel_width_idx
-=
padding_width_start
;
const
int
space_data_offset
=
space_idx
*
(
space_channel
*
space_height
*
space_width
)
+
const
int
space_data_offset
=
space_idx
*
(
space_channel
*
space_height
*
space_width
)
+
...
...
mace/ops/batch_to_space.h
浏览文件 @
3f8fa54b
...
@@ -22,6 +22,7 @@ static void BatchToSpaceHelper(const Tensor *input_tensor,
...
@@ -22,6 +22,7 @@ static void BatchToSpaceHelper(const Tensor *input_tensor,
const
index_t
block_dims
=
block_shape_tensor
->
dim
(
0
);
const
index_t
block_dims
=
block_shape_tensor
->
dim
(
0
);
MACE_CHECK
(
block_dims
==
cropped_tensor
->
dim
(
0
)
&&
2
==
cropped_tensor
->
dim
(
1
));
MACE_CHECK
(
block_dims
==
cropped_tensor
->
dim
(
0
)
&&
2
==
cropped_tensor
->
dim
(
1
));
// TODO change tensor to attribute if needed based on the benchmark
Tensor
::
MappingGuard
block_shape_tensor_mapper
(
block_shape_tensor
);
Tensor
::
MappingGuard
block_shape_tensor_mapper
(
block_shape_tensor
);
Tensor
::
MappingGuard
cropped_tensor_mapper
(
cropped_tensor
);
Tensor
::
MappingGuard
cropped_tensor_mapper
(
cropped_tensor
);
const
int
*
block_shape_ptr
=
block_shape_tensor
->
data
<
int
>
();
const
int
*
block_shape_ptr
=
block_shape_tensor
->
data
<
int
>
();
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录