Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
兔爷不爱我
mindspore
提交
92bebe65
M
mindspore
项目概览
兔爷不爱我
/
mindspore
与 Fork 源项目一致
Fork自
MindSpore / mindspore
通知
1
Star
0
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
92bebe65
编写于
9月 02, 2020
作者:
K
kingxian
提交者:
jinxiaoxian
9月 04, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
cell init performance opt
上级
e06dc0a9
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
3 deletion
+9
-3
mindspore/nn/cell.py
mindspore/nn/cell.py
+5
-1
tests/st/ops/cpu/test_maxpool_op.py
tests/st/ops/cpu/test_maxpool_op.py
+2
-2
tests/ut/cpp/runtest.sh
tests/ut/cpp/runtest.sh
+1
-0
tests/ut/python/runtest.sh
tests/ut/python/runtest.sh
+1
-0
未找到文件。
mindspore/nn/cell.py
浏览文件 @
92bebe65
...
...
@@ -16,6 +16,7 @@
import
inspect
import
time
import
gc
import
os
from
collections
import
OrderedDict
import
numpy
from
mindspore
import
log
as
logger
...
...
@@ -73,8 +74,11 @@ class Cell:
self
.
_parameter_layout_dict
=
{}
self
.
_create_time
=
int
(
time
.
time
()
*
1e9
)
init_backend
()
# call gc to release GE session resources used by non-used cell objects
gc
.
collect
()
if
os
.
getenv
(
'GC_COLLECT_IN_CELL'
)
==
'1'
:
gc
.
collect
()
self
.
_construct_inputs_num
=
0
self
.
_construct_inputs_names
=
[]
self
.
_auto_parallel_mode
=
False
...
...
tests/st/ops/cpu/test_maxpool_op.py
浏览文件 @
92bebe65
...
...
@@ -35,10 +35,10 @@ class Net_Pool(nn.Cell):
class
Net_Pool2
(
nn
.
Cell
):
def
__init__
(
self
):
super
(
Net_Pool2
,
self
).
__init__
()
self
.
maxpool_fun
=
nn
.
MaxPool2d
(
kernel_size
=
3
,
stride
=
2
,
pad_mode
=
"SAME"
)
self
.
maxpool_fun
2
=
nn
.
MaxPool2d
(
kernel_size
=
3
,
stride
=
2
,
pad_mode
=
"SAME"
)
def
construct
(
self
,
x
):
return
self
.
maxpool_fun
(
x
)
return
self
.
maxpool_fun
2
(
x
)
@
pytest
.
mark
.
level0
...
...
tests/ut/cpp/runtest.sh
浏览文件 @
92bebe65
...
...
@@ -29,6 +29,7 @@ cd ${BUILD_PATH}/mindspore/tests/ut/cpp
export
LD_LIBRARY_PATH
=
${
BUILD_PATH
}
/mindspore/googletest/googlemock/gtest:
${
PROJECT_PATH
}
/mindspore:
${
PROJECT_PATH
}
/mindspore/lib:
$LD_LIBRARY_PATH
export
PYTHONPATH
=
${
PROJECT_PATH
}
/tests/ut/cpp/python_input:
$PYTHONPATH
:
${
PROJECT_PATH
}
export
GLOG_v
=
2
export
GC_COLLECT_IN_CELL
=
1
## prepare data for dataset & mindrecord
cp
-fr
$PROJECT_PATH
/tests/ut/data
${
PROJECT_PATH
}
/build/mindspore/tests/ut/cpp/
...
...
tests/ut/python/runtest.sh
浏览文件 @
92bebe65
...
...
@@ -27,6 +27,7 @@ fi
export
LD_LIBRARY_PATH
=
$LD_LIBRARY_PATH
:
${
BUILD_PATH
}
/third_party/gtest/lib
export
PYTHONPATH
=
$PYTHONPATH
:
${
PROJECT_PATH
}
:
${
PROJECT_PATH
}
/tests/ut/cpp/python_input:
${
PROJECT_PATH
}
/tests/ut/python
echo
"export PYTHONPATH=
$PYTHONPATH
"
export
GC_COLLECT_IN_CELL
=
1
if
[
$#
-eq
1
]
&&
([
"
$1
"
==
"stage1"
]
||
[
"
$1
"
==
"stage2"
]
||
[
"
$1
"
==
"stage3"
])
;
then
if
[
$1
==
"stage1"
]
;
then
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录