Skip to content

Commit

Permalink
Removed wrong attribute removal.
Browse files Browse the repository at this point in the history
  • Loading branch information
popovaan authored and Gleb Kazantaev committed Oct 20, 2021
1 parent 4b848c3 commit 673214e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
7 changes: 0 additions & 7 deletions model-optimizer/extensions/middle/PreserveRuntimeInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ def preserve_rt_info(graph: Graph):
# source mode is used to keep tensor names at Parameter node
op.out_port(0).get_connection().insert_node(transpose, "source")

transpose.infer(transpose)

if op.has_valid('permute_attrs'):
del op['permute_attrs']
if op.out_node(0).has_valid('permutation'):
Expand All @@ -91,15 +89,10 @@ def preserve_rt_info(graph: Graph):
op.rt_info.info[('old_api_map', old_api_map.get_version())] = old_api_map
op.rt_info.info[('old_api_map', old_api_map.get_version())].old_api_transpose_result(permutation.perm)

if in_data_node.has_valid('permutation'):
del in_data_node['permutation']

# keep result in the framework format
transpose = create_op_node_with_second_input(graph, Transpose, permutation.inv)
# preserve output node name as it is used as output name in legacy IE API
transpose.name = in_node.name
in_node.name += "/prev"

prev_node_out_port.get_connection().insert_node(transpose)
in_node.infer(in_node)
transpose.infer(transpose)
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ def test_transpose_insert(self, nhwc_to_nchw_order, nchw_to_nhwc_order, add_perm

self.assertFalse(param_node.has_valid('permute_attrs'))
self.assertFalse(param_node.out_node(0).has_valid('permutation'))
self.assertFalse(result_node.in_node(0).has_valid('permutation'))

if add_permutation_attrs:
rt_info = param_node.rt_info.info
Expand Down

0 comments on commit 673214e

Please sign in to comment.