Skip to content

Commit

Permalink
Speed up group executor (apache#16069)
Browse files Browse the repository at this point in the history
* Speed up group executor

Current implementation is O(n^2), this implementation is O(n)

* Speed up group executor

Current implementation is O(n^2), this implementation is O(n)

* CI
  • Loading branch information
doronsinger authored and gyshi committed Sep 7, 2019
1 parent 52ab212 commit 9825de6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/mxnet/module/executor_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,9 @@ def __init__(self, symbol, contexts, workload, data_shapes, label_shapes, param_
self.data_layouts = None
self.label_layouts = None
self.output_names = self.symbol.list_outputs()
self.output_layouts = [DataDesc.get_batch_axis(self.symbol[name].attr('__layout__'))
for name in self.output_names]
self.num_outputs = len(self.symbol.list_outputs())
self.num_outputs = len(self.output_names)
self.output_layouts = [DataDesc.get_batch_axis(self.symbol[index].attr('__layout__'))
for index in range(self.num_outputs)]

self.bind_exec(data_shapes, label_shapes, shared_group)

Expand Down

0 comments on commit 9825de6

Please sign in to comment.