@@ -229,6 +229,7 @@ class SyncBatchNorm(paddle.nn.SyncBatchNorm):
...
@@ -229,6 +229,7 @@ class SyncBatchNorm(paddle.nn.SyncBatchNorm):
Shapes:
Shapes:
input: Tensor that the dimension from 2 to 5.
input: Tensor that the dimension from 2 to 5.
output: Tensor with the same shape as input.
output: Tensor with the same shape as input.
Examples:
Examples:
...
@@ -278,7 +279,7 @@ class SyncBatchNorm(paddle.nn.SyncBatchNorm):
...
@@ -278,7 +279,7 @@ class SyncBatchNorm(paddle.nn.SyncBatchNorm):
@classmethod
@classmethod
defconvert_sync_batchnorm(cls,layer):
defconvert_sync_batchnorm(cls,layer):
"""
r"""
Helper function to convert :class: `paddle.incubate.sparse.nn.BatchNorm` layers in the model to :class: `paddle.incubate.sparse.nn.SyncBatchNorm` layers.
Helper function to convert :class: `paddle.incubate.sparse.nn.BatchNorm` layers in the model to :class: `paddle.incubate.sparse.nn.SyncBatchNorm` layers.
Parameters:
Parameters:
...
@@ -290,13 +291,14 @@ class SyncBatchNorm(paddle.nn.SyncBatchNorm):
...
@@ -290,13 +291,14 @@ class SyncBatchNorm(paddle.nn.SyncBatchNorm):
Examples:
Examples:
.. code-block:: python
.. code-block:: python
import paddle
import paddle
import paddle.incubate.sparse.nn as nn
import paddle.incubate.sparse.nn as nn
model = paddle.nn.Sequential(nn.Conv3D(3, 5, 3), nn.BatchNorm(5))
model = paddle.nn.Sequential(nn.Conv3D(3, 5, 3), nn.BatchNorm(5))