From 90b51d6c8916b269f6d226652d1e5f8ab92ebd0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cliuxiao=E2=80=9D?= Date: Thu, 28 May 2020 22:37:06 +0800 Subject: [PATCH] fix SequentialCell --- mindspore/nn/layer/container.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mindspore/nn/layer/container.py b/mindspore/nn/layer/container.py index 5cb378ae6c..b9ce230aec 100644 --- a/mindspore/nn/layer/container.py +++ b/mindspore/nn/layer/container.py @@ -105,6 +105,9 @@ class SequentialCell(Cell): self.insert_child_to_cell(name, cell) else: 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()) def __getitem__(self, index):