Skip to content

Commit 60aa8d4

Browse files
committed
Fix torch ci
1 parent 5fc7b6a commit 60aa8d4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

keras/src/layers/preprocessing/image_preprocessing/random_grayscale.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,13 @@ def __init__(self, factor=0.5, data_format=None, **kwargs):
5757
self.random_generator = self.backend.random.SeedGenerator()
5858

5959
def get_random_transformation(self, images, training=True, seed=None):
60+
if seed is None:
61+
seed = self._get_seed_generator(self.backend._backend)
6062
random_values = self.backend.random.uniform(
6163
shape=(self.backend.core.shape(images)[0],),
6264
minval=0,
6365
maxval=1,
64-
seed=self.random_generator,
66+
seed=seed,
6567
)
6668
should_apply = self.backend.numpy.expand_dims(
6769
random_values < self.factor, axis=[1, 2, 3]

0 commit comments

Comments
 (0)