Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
magicwindyyd
mindspore
提交
94d0d45a
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看板
提交
94d0d45a
编写于
7月 09, 2020
作者:
J
jzg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
increase the max size of tensor.
上级
b4e37158
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
8 deletion
+19
-8
mindspore/ccsrc/kernel/aicpu/aicpu_kernel_build.cc
mindspore/ccsrc/kernel/aicpu/aicpu_kernel_build.cc
+8
-8
mindspore/ccsrc/utils/convert_utils_base.h
mindspore/ccsrc/utils/convert_utils_base.h
+11
-0
未找到文件。
mindspore/ccsrc/kernel/aicpu/aicpu_kernel_build.cc
浏览文件 @
94d0d45a
...
...
@@ -65,16 +65,16 @@ bool SetIOIputSize(const std::shared_ptr<AnfNode> &anf_node, const size_t &input
}
else
{
auto
type_ptr
=
TypeIdToType
(
AnfAlgo
::
GetInputDeviceDataType
(
anf_node
,
i
));
MS_EXCEPTION_IF_NULL
(
type_ptr
);
int
size_i
=
1
;
int
64_t
size_i
=
1
;
for
(
size_t
j
=
0
;
j
<
shape_i
.
size
();
j
++
)
{
Int
MulWithOverflowCheck
(
size_i
,
static_cast
<
int
>
(
shape_i
[
j
]),
&
size_i
);
Long
MulWithOverflowCheck
(
size_i
,
static_cast
<
int
>
(
shape_i
[
j
]),
&
size_i
);
}
size_t
type_byte
=
GetTypeByte
(
type_ptr
);
if
(
type_byte
==
0
)
{
return
false
;
}
Int
MulWithOverflowCheck
(
size_i
,
SizeToInt
(
type_byte
),
&
size_i
);
input_size_list
->
push_back
(
Int
ToSize
(
size_i
));
Long
MulWithOverflowCheck
(
size_i
,
SizeToInt
(
type_byte
),
&
size_i
);
input_size_list
->
push_back
(
Long
ToSize
(
size_i
));
}
}
return
true
;
...
...
@@ -97,16 +97,16 @@ bool SetIOSize(const std::shared_ptr<AnfNode> &anf_node, const std::shared_ptr<A
std
::
vector
<
size_t
>
shape_i
=
AnfAlgo
::
GetOutputDeviceShape
(
anf_node
,
i
);
TypePtr
type_ptr
=
TypeIdToType
(
AnfAlgo
::
GetOutputDeviceDataType
(
anf_node
,
i
));
MS_EXCEPTION_IF_NULL
(
type_ptr
);
int
size_i
=
1
;
int
64_t
size_i
=
1
;
for
(
size_t
j
=
0
;
j
<
shape_i
.
size
();
j
++
)
{
Int
MulWithOverflowCheck
(
size_i
,
static_cast
<
int
>
(
shape_i
[
j
]),
&
size_i
);
Long
MulWithOverflowCheck
(
size_i
,
static_cast
<
int
>
(
shape_i
[
j
]),
&
size_i
);
}
size_t
type_byte
=
GetTypeByte
(
type_ptr
);
if
(
type_byte
==
0
)
{
return
false
;
}
Int
MulWithOverflowCheck
(
size_i
,
SizeToInt
(
type_byte
),
&
size_i
);
output_size_list
.
push_back
(
Int
ToSize
(
size_i
));
Long
MulWithOverflowCheck
(
size_i
,
SizeToInt
(
type_byte
),
&
size_i
);
output_size_list
.
push_back
(
Long
ToSize
(
size_i
));
}
kernel_mod_ptr
->
SetOutputSizeList
(
output_size_list
);
return
true
;
...
...
mindspore/ccsrc/utils/convert_utils_base.h
浏览文件 @
94d0d45a
...
...
@@ -102,6 +102,17 @@ inline void IntMulWithOverflowCheck(int a, int b, int *c) {
*
c
=
out
;
}
inline
void
LongMulWithOverflowCheck
(
int64_t
a
,
int64_t
b
,
int64_t
*
c
)
{
int64_t
out
=
a
*
b
;
if
(
a
!=
0
)
{
bool
ok
=
((
out
/
a
)
!=
b
);
if
(
ok
)
{
MS_LOG
(
EXCEPTION
)
<<
"Mul: a("
<<
a
<<
") * b("
<<
b
<<
") result is overflow"
;
}
}
*
c
=
out
;
}
inline
size_t
SizetMulWithOverflowCheck
(
size_t
a
,
size_t
b
)
{
size_t
out
=
a
*
b
;
if
(
a
!=
0
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录