Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
5946b4a4
"vscode:/vscode.git/clone" did not exist on "c203bf67117ca06b1dbd45b1f88e49c9b8a41db9"
Unverified
Commit
5946b4a4
authored
Feb 03, 2021
by
ZHANG Zhi
Committed by
GitHub
Feb 03, 2021
Browse files
Add to permit (#3357)
parent
06e438b7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
0 deletions
+8
-0
nni/retiarii/converter/graph_gen.py
nni/retiarii/converter/graph_gen.py
+5
-0
nni/retiarii/converter/op_types.py
nni/retiarii/converter/op_types.py
+1
-0
nni/retiarii/operation.py
nni/retiarii/operation.py
+2
-0
No files found.
nni/retiarii/converter/graph_gen.py
View file @
5946b4a4
...
...
@@ -315,6 +315,11 @@ class GraphConverter:
new_node
=
ir_graph
.
add_node
(
build_full_name
(
module_name
,
OpTypeName
.
ListConstruct
,
self
.
global_seq
),
node
.
kind
())
node_index
[
node
]
=
new_node
self
.
_add_edge
(
ir_graph
,
node
,
graph_inputs
,
node_index
,
new_node
,
output_remap
)
elif
node
.
kind
()
==
'prim::TupleConstruct'
:
self
.
global_seq
+=
1
new_node
=
ir_graph
.
add_node
(
build_full_name
(
module_name
,
OpTypeName
.
TupleConstruct
,
self
.
global_seq
),
node
.
kind
())
node_index
[
node
]
=
new_node
self
.
_add_edge
(
ir_graph
,
node
,
graph_inputs
,
node_index
,
new_node
,
output_remap
)
elif
node
.
kind
()
==
'aten::append'
:
self
.
global_seq
+=
1
aten_node
=
ir_graph
.
add_node
(
build_full_name
(
module_name
,
BasicOpsPT
[
node
.
kind
()],
self
.
global_seq
),
node
.
kind
())
...
...
nni/retiarii/converter/op_types.py
View file @
5946b4a4
...
...
@@ -10,6 +10,7 @@ class OpTypeName(str, Enum):
Attr
=
'Attr'
Constant
=
'Constant'
ListConstruct
=
'ListConstruct'
TupleConstruct
=
'TupleConstruct'
LayerChoice
=
'LayerChoice'
InputChoice
=
'InputChoice'
ValueChoice
=
'ValueChoice'
...
...
nni/retiarii/operation.py
View file @
5946b4a4
...
...
@@ -121,6 +121,8 @@ class PyTorchOperation(Operation):
return
f
'
{
output
}
=
{
value
}
'
elif
self
.
type
==
'prim::ListConstruct'
:
return
f
'
{
output
}
= [
{
", "
.
join
(
inputs
)
}
]'
elif
self
.
type
==
'prim::TupleConstruct'
:
return
f
'
{
output
}
= (
{
", "
.
join
(
inputs
)
}
)'
elif
self
.
type
==
'prim::GetAttr'
:
return
f
"
{
output
}
=
{
self
.
parameters
[
'input'
]
}
.
{
self
.
parameters
[
'name'
]
}
"
elif
self
.
type
==
'aten::mean'
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment