Browse Source

fix SequentialCell

tags/v0.5.0-beta
“liuxiao” 5 years ago
parent
commit
90b51d6c89
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      mindspore/nn/layer/container.py

+ 3
- 0
mindspore/nn/layer/container.py View File

@@ -105,6 +105,9 @@ class SequentialCell(Cell):
self.insert_child_to_cell(name, cell) self.insert_child_to_cell(name, cell)
else: else:
raise TypeError('Cells must be list or orderedDict') raise TypeError('Cells must be list or orderedDict')
else:
for index, cell in enumerate(args):
self.insert_child_to_cell(str(index), cell)
self.cell_list = list(self._cells.values()) self.cell_list = list(self._cells.values())


def __getitem__(self, index): def __getitem__(self, index):


Loading…
Cancel
Save