Skip to content

Commit

Permalink
fix unittest, test=develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ceci3 committed Aug 18, 2020
1 parent c3d6db6 commit 5130ae3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions python/paddle/fluid/dygraph/nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -3260,7 +3260,7 @@ class SyncBatchNorm(layers.Layer):
x = np.array([[[[0.3, 0.4], [0.3, 0.07]], [[0.83, 0.37], [0.18, 0.93]]]]).astype('float32')
paddle.disable_static()
x = paddle.to_variable(x)
x = paddle.to_tensor(x)
if paddle.fluid.is_compiled_with_cuda():
sync_batch_norm = nn.SyncBatchNorm(2)
hidden1 = sync_batch_norm(x)
Expand Down Expand Up @@ -3296,9 +3296,7 @@ def __init__(self,
# create parameter
if weight_attr == False:
self.weight = self.create_parameter(
attr=self._weight_attr,
shape=param_shape,
default_initializer=Constant(1.0))
attr=None, shape=param_shape, default_initializer=Constant(1.0))
self.weight.stop_gradient = True
else:
self.weight = self.create_parameter(
Expand All @@ -3309,7 +3307,7 @@ def __init__(self,

if bias_attr == False:
self.bias = self.create_parameter(
attr=self._bias_attr,
attr=None,
shape=param_shape,
default_initializer=Constant(0.0),
is_bias=True)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __init__(self,
self._sync_batch_norm = SyncBatchNorm(num_filters)

self._conv2 = Conv2D(
num_channels=num_channels,
num_channels=num_filters,
num_filters=num_filters,
filter_size=filter_size,
stride=stride,
Expand Down

1 comment on commit 5130ae3

@paddle-bot-old
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Congratulation! Your pull request passed all required CI. You could ask reviewer(s) to approve and merge. 🎉

Please sign in to comment.