Skip to content

Commit cdb58ef

Browse files
make sure in_channels is not accessed directly
1 parent ed0d30c commit cdb58ef

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

tests/fixtures/custom_pipeline/pipeline.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __call__(
7373

7474
# Sample gaussian noise to begin loop
7575
image = torch.randn(
76-
(batch_size, self.unet.in_channels, self.unet.sample_size, self.unet.sample_size),
76+
(batch_size, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size),
7777
generator=generator,
7878
)
7979
image = image.to(self.device)

tests/fixtures/custom_pipeline/what_ever.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ def __call__(
7373

7474
# Sample gaussian noise to begin loop
7575
image = torch.randn(
76-
(batch_size, self.unet.in_channels, self.unet.sample_size, self.unet.sample_size),
76+
(batch_size, self.unet.config.in_channels, self.unet.config.sample_size, self.unet.config.sample_size),
7777
generator=generator,
7878
)
7979
image = image.to(self.device)

tests/models/test_models_unet_1d.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_output_pretrained(self):
116116
if torch.cuda.is_available():
117117
torch.cuda.manual_seed_all(0)
118118

119-
num_features = model.in_channels
119+
num_features = model.config.in_channels
120120
seq_len = 16
121121
noise = torch.randn((1, seq_len, num_features)).permute(
122122
0, 2, 1
@@ -264,7 +264,7 @@ def test_output_pretrained(self):
264264
if torch.cuda.is_available():
265265
torch.cuda.manual_seed_all(0)
266266

267-
num_features = value_function.in_channels
267+
num_features = value_function.config.in_channels
268268
seq_len = 14
269269
noise = torch.randn((1, seq_len, num_features)).permute(
270270
0, 2, 1

0 commit comments

Comments
 (0)