You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mindspore.nn.SequentialCell.rst 1.1 kB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
12345678910111213141516171819202122232425262728293031323334
  1. mindspore.nn.SequentialCell
  2. ============================
  3. .. py:class:: mindspore.nn.SequentialCell(*args)
  4. 构造Cell顺序容器。关于Cell的介绍,可参考 `<https://www.mindspore.cn/docs/api/zh-CN/master/api_python/nn/mindspore.nn.Cell.html#mindspore.nn.Cell>`_。
  5. SequentialCell将按照传入List的顺序依次将Cell添加。此外,也支持OrderedDict作为构造器传入。
  6. .. note:: SequentialCell 和 torch.nn.ModuleList 是不同的,ModuleList是一个用于存储模块的列表,但SequentialCell中的Cell是以级联方式连接的,不是单纯的存储。
  7. **参数:**
  8. **args** (list, OrderedDict) - 仅包含Cell子类的列表或有序字典。
  9. **输入:**
  10. **x** (Tensor) - Tensor,其shape取决于序列中的第一个Cell。
  11. **输出:**
  12. Tensor,输出Tensor,其shape取决于输入 `x` 和定义的Cell序列。
  13. **异常:**
  14. **TypeError** - `args` 的类型不是列表或有序字典。
  15. .. py:method:: append(cell)
  16. 在容器末尾添加一个Cell。
  17. **参数:**
  18. **cell** (Cell) - 要添加的Cell。