Skip to content

Commit bdaa667

Browse files
authored
Merge pull request #164 from cjfghk5697/functional
delete torch.nn.functional import and torch as th import
2 parents b1f5c8e + ce816b9 commit bdaa667

2 files changed

Lines changed: 1 addition & 3 deletions

File tree

labml_nn/diffusion/stable_diffusion/latent_diffusion.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
import torch
2727
import torch.nn as nn
28-
import torch.nn.functional
2928

3029
from labml_nn.diffusion.stable_diffusion.model.autoencoder import Autoencoder
3130
from labml_nn.diffusion.stable_diffusion.model.clip_embedder import CLIPTextEmbedder

labml_nn/diffusion/stable_diffusion/model/unet.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020

2121
import numpy as np
2222
import torch
23-
import torch as th
2423
import torch.nn as nn
2524
import torch.nn.functional as F
2625

@@ -174,7 +173,7 @@ def forward(self, x: torch.Tensor, time_steps: torch.Tensor, cond: torch.Tensor)
174173
x = self.middle_block(x, t_emb, cond)
175174
# Output half of the U-Net
176175
for module in self.output_blocks:
177-
x = th.cat([x, x_input_block.pop()], dim=1)
176+
x = torch.cat([x, x_input_block.pop()], dim=1)
178177
x = module(x, t_emb, cond)
179178

180179
# Final normalization and $3 \times 3$ convolution

0 commit comments

Comments
 (0)