mirror of
https://github.com/huggingface/diffusers.git
synced 2026-01-29 07:22:12 +03:00
remove more unused func
This commit is contained in:
@@ -33,11 +33,6 @@ def to_np(tensor):
|
||||
return tensor
|
||||
|
||||
|
||||
def check_same_shape(tensor_list):
|
||||
shapes = [tensor.shape for tensor in tensor_list]
|
||||
return all(shape == shapes[0] for shape in shapes[1:])
|
||||
|
||||
|
||||
class ModularIPAdapterTesterMixin:
|
||||
"""
|
||||
This mixin is designed to be used with PipelineTesterMixin and unittest.TestCase classes.
|
||||
@@ -677,13 +672,3 @@ class ModularPipelineTesterMixin:
|
||||
out_cfg = pipe(**inputs, output="images")
|
||||
|
||||
assert out_cfg.shape == out_no_cfg.shape
|
||||
|
||||
|
||||
# Some models (e.g. unCLIP) are extremely likely to significantly deviate depending on which hardware is used.
|
||||
# This helper function is used to check that the image doesn't deviate on average more than 10 pixels from a
|
||||
# reference image.
|
||||
def assert_mean_pixel_difference(image, expected_image, expected_max_diff=10):
|
||||
image = np.asarray(DiffusionPipeline.numpy_to_pil(image)[0], dtype=np.float32)
|
||||
expected_image = np.asarray(DiffusionPipeline.numpy_to_pil(expected_image)[0], dtype=np.float32)
|
||||
avg_diff = np.abs(image - expected_image).mean()
|
||||
assert avg_diff < expected_max_diff, f"Error image deviates {avg_diff} pixels on average"
|
||||
|
||||
Reference in New Issue
Block a user