Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Mr.Vain
Mace
提交
63135b06
Mace
项目概览
Mr.Vain
/
Mace
与 Fork 源项目一致
Fork自
Xiaomi / Mace
通知
1
Star
1
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看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
63135b06
编写于
8月 31, 2018
作者:
Y
yejianwu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix typo, clean redundant enum in transformer
上级
6439dce1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
8 addition
and
9 deletion
+8
-9
mace/kernels/opencl/lstmcell.cc
mace/kernels/opencl/lstmcell.cc
+6
-3
mace/ops/lstmcell.h
mace/ops/lstmcell.h
+0
-3
mace/python/tools/converter_tool/base_converter.py
mace/python/tools/converter_tool/base_converter.py
+2
-3
未找到文件。
mace/kernels/opencl/lstmcell.cc
浏览文件 @
63135b06
...
...
@@ -31,8 +31,12 @@ MaceStatus LSTMCellFunctor<DeviceType::GPU, T>::operator()(
Tensor
*
cell
,
Tensor
*
output
,
StatsFuture
*
future
)
{
MACE_CHECK
(
input
->
dim_size
()
==
2
&&
input
->
dim
(
1
)
%
4
==
0
,
"LSTM step should be a multiple of 4"
);
const
index_t
height
=
input
->
dim
(
0
);
const
index_t
width
=
input
->
dim
(
1
);
const
index_t
width_blocks
=
width
/
4
;
auto
runtime
=
OpenCLRuntime
::
Global
();
...
...
@@ -53,14 +57,13 @@ MaceStatus LSTMCellFunctor<DeviceType::GPU, T>::operator()(
static_cast
<
uint32_t
>
(
runtime
->
GetKernelMaxWorkGroupSize
(
kernel_
));
}
const
index_t
width_blocks
=
RoundUpDiv4
(
width
);
const
uint32_t
gws
[
2
]
=
{
static_cast
<
uint32_t
>
(
width_blocks
),
static_cast
<
uint32_t
>
(
height
)};
if
(
!
IsVecEqual
(
input_shape_
,
input
->
shape
()))
{
std
::
vector
<
index_t
>
output_shape_paded
=
{
height
,
1
,
1
,
width
};
std
::
vector
<
index_t
>
output_shape_pad
d
ed
=
{
height
,
1
,
1
,
width
};
std
::
vector
<
size_t
>
output_image_shape
;
CalImage2DShape
(
output_shape_paded
,
BufferType
::
IN_OUT_CHANNEL
,
CalImage2DShape
(
output_shape_pad
d
ed
,
BufferType
::
IN_OUT_CHANNEL
,
&
output_image_shape
);
MACE_RETURN_IF_ERROR
(
output
->
ResizeImage
(
input
->
shape
(),
output_image_shape
));
...
...
mace/ops/lstmcell.h
浏览文件 @
63135b06
...
...
@@ -40,9 +40,6 @@ class LSTMCellOp : public Operator<D, T> {
Tensor
*
cell
=
this
->
Output
(
CELL
);
Tensor
*
output
=
this
->
Output
(
OUTPUT
);
MACE_CHECK
(
input
->
dim_size
()
==
2
&&
input
->
dim
(
1
)
%
4
==
0
,
"LSTM step should be a multiple of 4"
);
return
functor_
(
input
,
pre_output
,
weight
,
bias
,
pre_cell
,
cell
,
output
,
future
);
};
...
...
mace/python/tools/converter_tool/base_converter.py
浏览文件 @
63135b06
...
...
@@ -200,9 +200,8 @@ class TransformerRule(Enum):
QUANTIZE_NODES
=
23
ADD_QUANTIZE_TENSOR_RANGE
=
24
QUANTIZE_WEIGHTS
=
25
TRANSPOSE_MATMUL_WEIGHT
=
26
TRANSFORM_LSTMCELL_ZEROSTATE
=
27
TRANSFORM_BASIC_LSTMCELL
=
28
TRANSFORM_LSTMCELL_ZEROSTATE
=
26
TRANSFORM_BASIC_LSTMCELL
=
27
class
ConverterInterface
(
object
):
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录