Skip to content

Commit 3f2ef25

Browse files
committed
address #249
1 parent fd5e62f commit 3f2ef25

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

denoising_diffusion_pytorch/denoising_diffusion_pytorch.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,12 @@ class SinusoidalPosEmb(nn.Module):
112112
def __init__(self, dim, theta = 10000):
113113
super().__init__()
114114
self.dim = dim
115+
self.theta = theta
115116

116117
def forward(self, x):
117118
device = x.device
118119
half_dim = self.dim // 2
119-
emb = math.log(theta) / (half_dim - 1)
120+
emb = math.log(self.theta) / (half_dim - 1)
120121
emb = torch.exp(torch.arange(half_dim, device=device) * -emb)
121122
emb = x[:, None] * emb[None, :]
122123
emb = torch.cat((emb.sin(), emb.cos()), dim=-1)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '1.8.10'
1+
__version__ = '1.8.11'

0 commit comments

Comments
 (0)