@@ -262,7 +262,7 @@ class SyncBatchNorm(paddle.nn.SyncBatchNorm):
# required: gpu
import paddle
import paddle.incubate.sparse.nn as nn
import paddle.sparse.nn as nn
import numpy as np
x = np.array([[[[0.3, 0.4], [0.3, 0.07]], [[0.83, 0.37], [0.18, 0.93]]]]).astype('float32')
...
...
@@ -306,7 +306,7 @@ class SyncBatchNorm(paddle.nn.SyncBatchNorm):
@classmethod
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.sparse.nn.BatchNorm` layers in the model to :class: `paddle.sparse.nn.SyncBatchNorm` layers.
Parameters:
layer(paddle.nn.Layer): model containing one or more `BatchNorm` layers.
...
...
@@ -319,7 +319,7 @@ class SyncBatchNorm(paddle.nn.SyncBatchNorm):
.. code-block:: python
import paddle
import paddle.incubate.sparse.nn as nn
import paddle.sparse.nn as nn
model = paddle.nn.Sequential(nn.Conv3D(3, 5, 3), nn.BatchNorm(5))