),"a mask with fewer tokens than condition, will be padded with 'keep' tokens. a 'discard-all' mask missing the final token is thus equivalent to a 'keep last' mask."
asserttrunc_mask_out.allclose(keeplast_out),(
"a mask with fewer tokens than condition, will be padded with 'keep' tokens. a 'discard-all' mask missing the final token is thus equivalent to a 'keep last' mask."
)
deftest_custom_diffusion_processors(self):
# enable deterministic behavior for gradient checkpointing
...
...
@@ -1114,12 +1114,12 @@ class UNet2DConditionModelTests(ModelTesterMixin, UNetTesterMixin, unittest.Test
withtorch.no_grad():
lora_sample_2=model(**inputs_dict).sample
assertnottorch.allclose(
non_lora_sample,lora_sample_1,atol=1e-4,rtol=1e-4
),"LoRA injected UNet should produce different results."
asserttorch.allclose(
lora_sample_1,lora_sample_2,atol=1e-4,rtol=1e-4
),"Loading from a saved checkpoint should produce identical results."