Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/pipelines/test_pipelines_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,15 @@ def test_freeu_enabled(self):

inputs = self.get_dummy_inputs(torch_device)
inputs["return_dict"] = False
inputs["output_type"] = "np"

output = pipe(**inputs)[0]

pipe.enable_freeu(s1=0.9, s2=0.2, b1=1.2, b2=1.4)
inputs = self.get_dummy_inputs(torch_device)
inputs["return_dict"] = False
inputs["output_type"] = "np"

output_freeu = pipe(**inputs)[0]

assert not np.allclose(
Expand All @@ -150,6 +154,8 @@ def test_freeu_disabled(self):

inputs = self.get_dummy_inputs(torch_device)
inputs["return_dict"] = False
inputs["output_type"] = "np"

output = pipe(**inputs)[0]

pipe.enable_freeu(s1=0.9, s2=0.2, b1=1.2, b2=1.4)
Expand All @@ -162,6 +168,8 @@ def test_freeu_disabled(self):

inputs = self.get_dummy_inputs(torch_device)
inputs["return_dict"] = False
inputs["output_type"] = "np"

output_no_freeu = pipe(**inputs)[0]
assert np.allclose(
output, output_no_freeu, atol=1e-2
Expand Down