Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
mindinsight
提交
563516b9
M
mindinsight
项目概览
MindSpore
/
mindinsight
通知
7
Star
3
Fork
2
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mindinsight
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
563516b9
编写于
4月 02, 2020
作者:
P
ph
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of gitee.com:mindspore/mindinsight into phdev
上级
e81ca340
e84c0e1f
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
53 addition
and
43 deletion
+53
-43
mindinsight/backend/__init__.py
mindinsight/backend/__init__.py
+1
-0
mindinsight/datavisual/common/__init__.py
mindinsight/datavisual/common/__init__.py
+1
-0
mindinsight/datavisual/data_transform/graph/graph.py
mindinsight/datavisual/data_transform/graph/graph.py
+15
-15
mindinsight/datavisual/data_transform/graph/msgraph.py
mindinsight/datavisual/data_transform/graph/msgraph.py
+1
-1
mindinsight/datavisual/data_transform/graph/node.py
mindinsight/datavisual/data_transform/graph/node.py
+32
-26
mindinsight/datavisual/data_transform/loader_generators/__init__.py
...t/datavisual/data_transform/loader_generators/__init__.py
+1
-0
mindinsight/datavisual/data_transform/summary_watcher.py
mindinsight/datavisual/data_transform/summary_watcher.py
+1
-1
tests/utils/__init__.py
tests/utils/__init__.py
+1
-0
未找到文件。
mindinsight/backend/__init__.py
浏览文件 @
563516b9
...
...
@@ -12,3 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""This module defines the methods associated with the web app."""
mindinsight/datavisual/common/__init__.py
浏览文件 @
563516b9
...
...
@@ -12,3 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""This module defines the public methods that are relevant to the business."""
mindinsight/datavisual/data_transform/graph/graph.py
浏览文件 @
563516b9
...
...
@@ -206,8 +206,8 @@ class Graph:
for
name_tmp
,
node_tmp
in
group
.
items
():
node_tmp
.
polymeric_scope_name
=
polymeric_node_name
self
.
_polymeric_nodes
.
update
({
name_tmp
:
node_tmp
})
polymeric_node
.
update_input
(
node_tmp
.
input
)
polymeric_node
.
update_output
(
node_tmp
.
output
)
polymeric_node
.
update_input
(
node_tmp
.
input
s
)
polymeric_node
.
update_output
(
node_tmp
.
output
s
)
self
.
_normal_nodes
.
update
({
polymeric_node_name
:
polymeric_node
})
...
...
@@ -227,7 +227,7 @@ class Graph:
for
node_name
,
group_node
in
group
.
items
():
node_list
=
[]
is_in_group
=
False
for
dst_name
in
group_node
.
output
:
for
dst_name
in
group_node
.
output
s
:
node_tmp
=
self
.
_leaf_nodes
[
dst_name
]
node_list
.
append
(
node_tmp
)
...
...
@@ -245,7 +245,7 @@ class Graph:
if
node_tmp
in
group
.
values
():
is_in_group
=
True
break
for
dst_name_tmp
in
node_tmp
.
output
:
for
dst_name_tmp
in
node_tmp
.
output
s
:
run_count
+=
1
node_tmp
=
self
.
_leaf_nodes
[
dst_name_tmp
]
if
visit_nodes
.
get
(
dst_name_tmp
):
...
...
@@ -273,23 +273,23 @@ class Graph:
def
_update_input_output
(
self
):
"""We need to update input and output attribute after build polymeric node."""
for
node
in
self
.
_normal_nodes
.
values
():
for
src_name
,
input_attr
in
node
.
input
.
items
():
for
src_name
,
input_attr
in
node
.
input
s
.
items
():
if
self
.
_polymeric_nodes
.
get
(
src_name
):
input_attr
[
'scope'
]
=
NodeTypeEnum
.
POLYMERIC_SCOPE
.
value
node
.
update_input
({
src_name
:
input_attr
})
for
dst_name
,
output_attr
in
node
.
output
.
items
():
for
dst_name
,
output_attr
in
node
.
output
s
.
items
():
if
self
.
_polymeric_nodes
.
get
(
dst_name
):
output_attr
[
'scope'
]
=
NodeTypeEnum
.
POLYMERIC_SCOPE
.
value
node
.
update_output
({
dst_name
:
output_attr
})
for
node
in
self
.
_polymeric_nodes
.
values
():
for
src_name
,
input_attr
in
node
.
input
.
items
():
for
src_name
,
input_attr
in
node
.
input
s
.
items
():
if
self
.
_polymeric_nodes
.
get
(
src_name
):
input_attr
[
'scope'
]
=
NodeTypeEnum
.
POLYMERIC_SCOPE
.
value
node
.
update_input
({
src_name
:
input_attr
})
for
dst_name
,
output_attr
in
node
.
output
.
items
():
for
dst_name
,
output_attr
in
node
.
output
s
.
items
():
if
self
.
_polymeric_nodes
.
get
(
dst_name
):
output_attr
[
'scope'
]
=
NodeTypeEnum
.
POLYMERIC_SCOPE
.
value
node
.
update_output
({
dst_name
:
output_attr
})
...
...
@@ -297,21 +297,21 @@ class Graph:
def
_update_polymeric_input_output
(
self
):
"""Calc polymeric input and output after build polymeric node."""
for
node
in
self
.
_normal_nodes
.
values
():
polymeric_input
=
self
.
_calc_polymeric_attr
(
node
,
'input'
)
polymeric_input
=
self
.
_calc_polymeric_attr
(
node
,
'input
s
'
)
node
.
update_polymeric_input
(
polymeric_input
)
polymeric_output
=
self
.
_calc_polymeric_attr
(
node
,
'output'
)
polymeric_output
=
self
.
_calc_polymeric_attr
(
node
,
'output
s
'
)
node
.
update_polymeric_output
(
polymeric_output
)
for
name
,
node
in
self
.
_polymeric_nodes
.
items
():
polymeric_input
=
{}
for
src_name
in
node
.
input
:
for
src_name
in
node
.
input
s
:
output_name
=
self
.
_calc_dummy_node_name
(
name
,
src_name
)
polymeric_input
.
update
({
output_name
:
{
'edge_type'
:
EdgeTypeEnum
.
DATA
.
value
}})
node
.
update_polymeric_input
(
polymeric_input
)
polymeric_output
=
{}
for
dst_name
in
node
.
output
:
for
dst_name
in
node
.
output
s
:
polymeric_output
=
{}
output_name
=
self
.
_calc_dummy_node_name
(
name
,
dst_name
)
polymeric_output
.
update
({
output_name
:
{
'edge_type'
:
EdgeTypeEnum
.
DATA
.
value
}})
...
...
@@ -410,12 +410,12 @@ class Graph:
# update the input and output of this to namescope node
name_scope_with_slash
=
name_scope
+
'/'
for
src_name
,
input_attr
in
node
.
input
.
items
():
for
src_name
,
input_attr
in
node
.
input
s
.
items
():
if
src_name
.
startswith
(
name_scope_with_slash
):
continue
name_scope_node
.
update_input
({
src_name
:
input_attr
})
for
dst_name
,
output_attr
in
node
.
output
.
items
():
for
dst_name
,
output_attr
in
node
.
output
s
.
items
():
if
dst_name
.
startswith
(
name_scope_with_slash
):
continue
name_scope_node
.
update_output
({
dst_name
:
output_attr
})
...
...
@@ -428,7 +428,7 @@ class Graph:
nodes
.
extend
(
self
.
_normal_nodes
.
values
())
nodes
.
extend
(
self
.
_polymeric_nodes
.
values
())
for
node
in
nodes
:
attrs
=
[
'input
'
,
'output'
,
'polymeric_input'
,
'polymeric_output
'
]
attrs
=
[
'input
s'
,
'outputs'
,
'polymeric_inputs'
,
'polymeric_outputs
'
]
for
item
in
attrs
:
tmp_dict
=
dict
(
getattr
(
node
,
item
))
for
name
,
value
in
tmp_dict
.
items
():
...
...
mindinsight/datavisual/data_transform/graph/msgraph.py
浏览文件 @
563516b9
...
...
@@ -138,7 +138,7 @@ class MSGraph(Graph):
for
name
,
node
in
self
.
_leaf_nodes
.
items
():
if
node
.
node_type
==
NodeTypeEnum
.
CONST
.
value
:
continue
for
src_name
,
input_attr
in
node
.
input
.
items
():
for
src_name
,
input_attr
in
node
.
input
s
.
items
():
src_node
=
self
.
_leaf_nodes
[
src_name
]
if
src_node
.
node_type
==
NodeTypeEnum
.
CONST
.
value
:
continue
...
...
mindinsight/datavisual/data_transform/graph/node.py
浏览文件 @
563516b9
...
...
@@ -39,11 +39,11 @@ class Node:
self
.
_name
=
name
self
.
_type
=
""
self
.
_attr
=
dict
()
self
.
_input
=
dict
()
self
.
_input
s
=
dict
()
self
.
_output_i
=
-
1
self
.
_output
=
{}
self
.
_polymeric_input
=
{}
self
.
_polymeric_output
=
{}
self
.
_output
s
=
{}
self
.
_polymeric_input
s
=
{}
self
.
_polymeric_output
s
=
{}
self
.
_polymeric_scope_name
=
""
self
.
_subnode_count
=
0
self
.
_name_scope
=
""
...
...
@@ -55,11 +55,11 @@ class Node:
'name'
:
self
.
_name
,
'type'
:
self
.
_type
,
'attr'
:
self
.
_attr
,
'input'
:
self
.
_input
,
'input'
:
self
.
_input
s
,
'output_i'
:
self
.
_output_i
,
'output'
:
self
.
_output
,
'polymeric_input'
:
self
.
_polymeric_input
,
'polymeric_output'
:
self
.
_polymeric_output
,
'output'
:
self
.
_output
s
,
'polymeric_input'
:
self
.
_polymeric_input
s
,
'polymeric_output'
:
self
.
_polymeric_output
s
,
'subnode_count'
:
self
.
_subnode_count
,
'polymeric_scope_name'
:
self
.
_polymeric_scope_name
}
...
...
@@ -99,28 +99,32 @@ class Node:
Update node attr.
Args:
attr_dict (dict[str, str]):
Format is {'<key>': '<value>'}
.
attr_dict (dict[str, str]):
The attr of node
.
"""
self
.
_attr
.
update
(
attr_dict
)
@
property
def
input
(
self
):
def
input
s
(
self
):
"""
Get all input of current node.
Returns:
dict[str, dict], format is {'<src_name>': {'shape': [], 'edge_type', 'scope'}}.
"""
return
self
.
_input
return
self
.
_input
s
def
update_input
(
self
,
input_dict
):
"""
Update input.
Args:
input_dict (dict[str, dict]): Format is {'<src_name>': {'shape': [], 'edge_type', 'scope'}}.
input_dict (dict[str, dict]): Key is a source node name, and the value is a dict.
- shape (list): The shape of input tensor.
- edge_type (str): The type of edge, optional value refer to `EdgeTypeEnum`.
- scope (str): The scope of this source node.
"""
self
.
_input
.
update
(
input_dict
)
self
.
_input
s
.
update
(
input_dict
)
@
property
def
output_i
(
self
):
...
...
@@ -133,49 +137,51 @@ class Node:
self
.
_output_i
=
output_i
@
property
def
polymeric_input
(
self
):
def
polymeric_input
s
(
self
):
"""
The polymeric input is the input of the polymeric nodes.
Returns:
dict[str, dict], format is {'<src_name>': {'edge_type': '<value>'}}.
"""
return
self
.
_polymeric_input
return
self
.
_polymeric_input
s
def
update_polymeric_input
(
self
,
polymeric_input
):
"""The polymeric input is the input of the polymeric nodes."""
self
.
_polymeric_input
.
update
(
polymeric_input
)
self
.
_polymeric_input
s
.
update
(
polymeric_input
)
@
property
def
output
(
self
):
def
output
s
(
self
):
"""The output node of this node."""
return
self
.
_output
return
self
.
_output
s
def
update_output
(
self
,
output
):
"""
Update output node.
Args:
output (dict[str, TypedDict('NodeType', {'type': str})]): Format
is {"<node_name>": {"type": "<node type>"}}.
output (dict[str, TypedDict('NodeType', {'type': str})]): Key is a dst node name, and value is a dict.
- type (str): The type of the dst node.
"""
self
.
_output
.
update
(
output
)
self
.
_output
s
.
update
(
output
)
@
property
def
polymeric_output
(
self
):
def
polymeric_output
s
(
self
):
"""Get polymeric output."""
return
self
.
_polymeric_output
return
self
.
_polymeric_output
s
def
update_polymeric_output
(
self
,
polymeric_output
):
"""
Update polymeric output.
Args:
polymeric_output (dict[str, dict): Format is {dst_node.polymeric_scope_name:
{'edge_type': EdgeTypeEnum.DATA.value}}).
polymeric_output (dict[str, dict): Key is the polymeric scope name of dst name, and value is dict.
- edge_type (str): The edge type of the dst node.
"""
self
.
_polymeric_output
.
update
(
polymeric_output
)
self
.
_polymeric_output
s
.
update
(
polymeric_output
)
@
property
def
polymeric_scope_name
(
self
):
...
...
mindinsight/datavisual/data_transform/loader_generators/__init__.py
浏览文件 @
563516b9
...
...
@@ -12,3 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""This module defines the generator for the loaders."""
mindinsight/datavisual/data_transform/summary_watcher.py
浏览文件 @
563516b9
...
...
@@ -32,7 +32,7 @@ class SummaryWatcher:
MAX_SUMMARY_DIR_COUNT
=
999
# scan at most 20000 files/directories (approximately 1 seconds)
# if overall
=
False in SummaryWatcher.list_summary_directories
# if overall
is
False in SummaryWatcher.list_summary_directories
# to avoid long-time blocking
MAX_SCAN_COUNT
=
20000
...
...
tests/utils/__init__.py
浏览文件 @
563516b9
...
...
@@ -12,3 +12,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============================================================================
"""This module defines common utility methods."""
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录