File tree Expand file tree Collapse file tree 1 file changed +0
-15
lines changed Expand file tree Collapse file tree 1 file changed +0
-15
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,6 @@ def to_np(tensor):
3333 return tensor
3434
3535
36- def check_same_shape (tensor_list ):
37- shapes = [tensor .shape for tensor in tensor_list ]
38- return all (shape == shapes [0 ] for shape in shapes [1 :])
39-
40-
4136class ModularIPAdapterTesterMixin :
4237 """
4338 This mixin is designed to be used with PipelineTesterMixin and unittest.TestCase classes.
@@ -677,13 +672,3 @@ def test_cfg(self):
677672 out_cfg = pipe (** inputs , output = "images" )
678673
679674 assert out_cfg .shape == out_no_cfg .shape
680-
681-
682- # Some models (e.g. unCLIP) are extremely likely to significantly deviate depending on which hardware is used.
683- # This helper function is used to check that the image doesn't deviate on average more than 10 pixels from a
684- # reference image.
685- def assert_mean_pixel_difference (image , expected_image , expected_max_diff = 10 ):
686- image = np .asarray (DiffusionPipeline .numpy_to_pil (image )[0 ], dtype = np .float32 )
687- expected_image = np .asarray (DiffusionPipeline .numpy_to_pil (expected_image )[0 ], dtype = np .float32 )
688- avg_diff = np .abs (image - expected_image ).mean ()
689- assert avg_diff < expected_max_diff , f"Error image deviates { avg_diff } pixels on average"
You can’t perform that action at this time.
0 commit comments