Skip to content

Commit

Permalink
change int to init
Browse files Browse the repository at this point in the history
  • Loading branch information
divyashreepathihalli committed Nov 14, 2023
1 parent fa9dde3 commit e4190e9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions keras_cv/backend/random.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ def next(self, ordered=True):
def normal(shape, mean=0.0, stddev=1.0, dtype=None, seed=None):
if isinstance(seed, SeedGenerator):
seed = seed.next()
int_seed = seed[0] + seed[1]
init_seed = seed[0] + seed[1]
else:
int_seed = seed
init_seed = seed
if keras_3():
return keras.random.normal(
shape, mean=mean, stddev=stddev, dtype=dtype, seed=int_seed
Expand All @@ -58,9 +58,9 @@ def normal(shape, mean=0.0, stddev=1.0, dtype=None, seed=None):
def uniform(shape, minval=0.0, maxval=1.0, dtype=None, seed=None):
if isinstance(seed, SeedGenerator):
seed = seed.next()
int_seed = seed[0] + seed[1]
init_seed = seed[0] + seed[1]
else:
int_seed = seed
init_seed = seed
if keras_3():
return keras.random.uniform(
shape, minval=minval, maxval=maxval, dtype=dtype, seed=int_seed
Expand All @@ -76,9 +76,9 @@ def uniform(shape, minval=0.0, maxval=1.0, dtype=None, seed=None):
def shuffle(x, axis=0, seed=None):
if isinstance(seed, SeedGenerator):
seed = seed.next()
int_seed = seed[0] + seed[1]
init_seed = seed[0] + seed[1]
else:
int_seed = seed
init_seed = seed
if keras_3():
return keras.random.shuffle(x=x, axis=axis, seed=int_seed)
else:
Expand All @@ -90,9 +90,9 @@ def shuffle(x, axis=0, seed=None):
def categorical(logits, num_samples, dtype="int32", seed=None):
if isinstance(seed, SeedGenerator):
seed = seed.next()
int_seed = seed[0] + seed[1]
init_seed = seed[0] + seed[1]
else:
int_seed = seed
init_seed = seed
if keras_3():
return keras.random.categorical(
logits=logits, num_samples=num_samples, dtype=dtype, seed=int_seed
Expand Down

0 comments on commit e4190e9

Please sign in to comment.