Unverified Commit 9c5253f1 authored by Toby Boyd's avatar Toby Boyd Committed by GitHub
Browse files

r/tf.random_uniform/tf.random.uniform (#6735)

parent 58856e2b
...@@ -643,6 +643,7 @@ class BaseDataConstructor(threading.Thread): ...@@ -643,6 +643,7 @@ class BaseDataConstructor(threading.Thread):
class DummyConstructor(threading.Thread): class DummyConstructor(threading.Thread):
"""Class for running with synthetic data.""" """Class for running with synthetic data."""
def run(self): def run(self):
pass pass
...@@ -666,15 +667,15 @@ class DummyConstructor(threading.Thread): ...@@ -666,15 +667,15 @@ class DummyConstructor(threading.Thread):
num_users = params["num_users"] num_users = params["num_users"]
num_items = params["num_items"] num_items = params["num_items"]
users = tf.random_uniform([batch_size], dtype=tf.int32, minval=0, users = tf.random.uniform([batch_size], dtype=tf.int32, minval=0,
maxval=num_users) maxval=num_users)
items = tf.random_uniform([batch_size], dtype=tf.int32, minval=0, items = tf.random.uniform([batch_size], dtype=tf.int32, minval=0,
maxval=num_items) maxval=num_items)
if is_training: if is_training:
valid_point_mask = tf.cast(tf.random_uniform( valid_point_mask = tf.cast(tf.random.uniform(
[batch_size], dtype=tf.int32, minval=0, maxval=2), tf.bool) [batch_size], dtype=tf.int32, minval=0, maxval=2), tf.bool)
labels = tf.cast(tf.random_uniform( labels = tf.cast(tf.random.uniform(
[batch_size], dtype=tf.int32, minval=0, maxval=2), tf.bool) [batch_size], dtype=tf.int32, minval=0, maxval=2), tf.bool)
data = { data = {
movielens.USER_COLUMN: users, movielens.USER_COLUMN: users,
...@@ -682,7 +683,7 @@ class DummyConstructor(threading.Thread): ...@@ -682,7 +683,7 @@ class DummyConstructor(threading.Thread):
rconst.VALID_POINT_MASK: valid_point_mask, rconst.VALID_POINT_MASK: valid_point_mask,
}, labels }, labels
else: else:
dupe_mask = tf.cast(tf.random_uniform([batch_size], dtype=tf.int32, dupe_mask = tf.cast(tf.random.uniform([batch_size], dtype=tf.int32,
minval=0, maxval=2), tf.bool) minval=0, maxval=2), tf.bool)
data = { data = {
movielens.USER_COLUMN: users, movielens.USER_COLUMN: users,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment