Uses Collection in transformers.image_transforms.normalize (#36301)

* Uses Collection instead of Sequence in transformers.image_transforms.normalize

* Uses collections.abc.Collection in lieu of deprecated typing one
This commit is contained in:
CalOmnie
2025-02-21 18:38:41 +01:00
committed by GitHub
parent 7c5bd24ffa
commit 547911e727
2 changed files with 10 additions and 9 deletions

View File

@@ -326,8 +326,8 @@ class ImageTransformsTester(unittest.TestCase):
# Test float16 image input keeps float16 dtype
image = np.random.randint(0, 256, (224, 224, 3)).astype(np.float16) / 255
mean = (0.5, 0.6, 0.7)
std = (0.1, 0.2, 0.3)
mean = np.array((0.5, 0.6, 0.7))
std = np.array((0.1, 0.2, 0.3))
# The mean and std are cast to match the dtype of the input image
cast_mean = np.array(mean, dtype=np.float16)