Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
7f7c006a
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看板
提交
7f7c006a
编写于
6月 17, 2020
作者:
B
baihuawei
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix lstm bug when hidden_size is zero
上级
30b19165
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
0 deletion
+13
-0
mindspore/ccsrc/kernel/cpu/mkldnn/lstm_cpu_kernel.cc
mindspore/ccsrc/kernel/cpu/mkldnn/lstm_cpu_kernel.cc
+4
-0
mindspore/ccsrc/kernel/cpu/mkldnn/lstm_cpu_kernel.h
mindspore/ccsrc/kernel/cpu/mkldnn/lstm_cpu_kernel.h
+6
-0
mindspore/nn/layer/lstm.py
mindspore/nn/layer/lstm.py
+3
-0
未找到文件。
mindspore/ccsrc/kernel/cpu/mkldnn/lstm_cpu_kernel.cc
浏览文件 @
7f7c006a
...
...
@@ -22,6 +22,10 @@
namespace
mindspore
{
namespace
kernel
{
void
LstmCPUKernel
::
InitKernel
(
const
CNodePtr
&
kernel_node
)
{
#ifdef PLATFORM_86
_MM_SET_FLUSH_ZERO_MODE
(
_MM_FLUSH_ZERO_ON
);
_MM_SET_DENORMALS_ZERO_MODE
(
_MM_DENORMALS_ZERO_ON
);
#endif
MS_EXCEPTION_IF_NULL
(
kernel_node
);
using
tag
=
dnnl
::
memory
::
format_tag
;
using
dim
=
dnnl
::
memory
::
dims
;
...
...
mindspore/ccsrc/kernel/cpu/mkldnn/lstm_cpu_kernel.h
浏览文件 @
7f7c006a
...
...
@@ -16,6 +16,12 @@
#ifndef MINDSPORE_CCSRC_KERNEL_CPU_LSTM_CPU_KERNEL_H_
#define MINDSPORE_CCSRC_KERNEL_CPU_LSTM_CPU_KERNEL_H_
#if defined(__x86_64__) || defined(__amd64__) || defined(_M_IX86) || defined(_M_X64)
#define PLATFORM_86
#endif
#ifdef PLATFORM_86
#include <pmmintrin.h>
#endif
#include <vector>
#include <memory>
#include "kernel/cpu/mkldnn/mkl_cpu_kernel.h"
...
...
mindspore/nn/layer/lstm.py
浏览文件 @
7f7c006a
...
...
@@ -23,6 +23,7 @@ from mindspore.common.parameter import Parameter, ParameterTuple
from
mindspore.common.tensor
import
Tensor
from
mindspore.nn.cell
import
Cell
from
mindspore.ops
import
operations
as
P
from
..._checkparam
import
Rel
__all__
=
[
'LSTM'
,
'LSTMCell'
]
...
...
@@ -123,6 +124,8 @@ class LSTM(Cell):
self
.
num_layers
=
num_layers
self
.
has_bias
=
has_bias
self
.
batch_first
=
validator
.
check_value_type
(
"batch_first"
,
batch_first
,
[
bool
],
self
.
cls_name
)
self
.
hidden_size
=
validator
.
check_integer
(
"hidden_size"
,
hidden_size
,
0
,
Rel
.
GT
,
self
.
cls_name
)
self
.
num_layers
=
validator
.
check_integer
(
"num_layers"
,
num_layers
,
0
,
Rel
.
GT
,
self
.
cls_name
)
self
.
dropout
=
float
(
dropout
)
self
.
bidirectional
=
bidirectional
if
self
.
batch_first
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录