Skip to content

Commit

Permalink
fix GroupNorm init
Browse files Browse the repository at this point in the history
  • Loading branch information
fpzh2011 committed Apr 19, 2024
1 parent 44ad994 commit a42da45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions python/oneflow/nn/modules/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,8 @@ def __init__(
if dtype:
factory_kwargs["dtype"] = dtype
if self.affine:
self.weight = flow.nn.Parameter(flow.Tensor(num_channels, **factory_kwargs))
self.bias = flow.nn.Parameter(flow.Tensor(num_channels, **factory_kwargs))
self.weight = flow.nn.Parameter(flow.Tensor(num_channels).to(**factory_kwargs))
self.bias = flow.nn.Parameter(flow.Tensor(num_channels).to(**factory_kwargs))
else:
self.register_parameter("weight", None)
self.register_parameter("bias", None)
Expand Down

0 comments on commit a42da45

Please sign in to comment.