Make LayerNorm.normalized_shape a tuple

Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/20832

Pulled By: driazati

Differential Revision: D15464693

fbshipit-source-id: 244f24d6917b17dde5e33ff852c716fb053b7ca5
This commit is contained in:
davidriazati
2019-05-23 10:40:32 -07:00
committed by Facebook Github Bot
parent 99b3f5cd70
commit 9c57d8df42

View File

@ -135,7 +135,7 @@ class LayerNorm(Module):
super(LayerNorm, self).__init__()
if isinstance(normalized_shape, numbers.Integral):
normalized_shape = (normalized_shape,)
self.normalized_shape = torch.Size(normalized_shape)
self.normalized_shape = tuple(normalized_shape)
self.eps = eps
self.elementwise_affine = elementwise_affine
if self.elementwise_affine: