mindspore.nn.PipelineCell

class mindspore.nn.PipelineCell(network, micro_size)[source]

Wrap the network with Micro Batch.

Note

micro_size must be greater or equal to pipeline stages.

Parameters
  • network (Cell) – The target network to wrap.

  • micro_size (int) – MicroBatch size.

Supported Platforms:

Ascend GPU

Examples

>>> import mindspore.nn as nn
>>> # Define the network structure of LeNet5. Refer to
>>> # https://gitee.com/mindspore/docs/blob/r2.1/docs/mindspore/code/lenet.py
>>> net = LeNet5()
>>> net = nn.PipelineCell(net, 4)