Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
9c5253f1
Unverified
Commit
9c5253f1
authored
May 08, 2019
by
Toby Boyd
Committed by
GitHub
May 08, 2019
Browse files
r/tf.random_uniform/tf.random.uniform (#6735)
parent
58856e2b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
official/recommendation/data_pipeline.py
official/recommendation/data_pipeline.py
+6
-5
No files found.
official/recommendation/data_pipeline.py
View file @
9c5253f1
...
...
@@ -643,6 +643,7 @@ class BaseDataConstructor(threading.Thread):
class
DummyConstructor
(
threading
.
Thread
):
"""Class for running with synthetic data."""
def
run
(
self
):
pass
...
...
@@ -666,15 +667,15 @@ class DummyConstructor(threading.Thread):
num_users
=
params
[
"num_users"
]
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
)
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
)
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
)
labels
=
tf
.
cast
(
tf
.
random
_
uniform
(
labels
=
tf
.
cast
(
tf
.
random
.
uniform
(
[
batch_size
],
dtype
=
tf
.
int32
,
minval
=
0
,
maxval
=
2
),
tf
.
bool
)
data
=
{
movielens
.
USER_COLUMN
:
users
,
...
...
@@ -682,7 +683,7 @@ class DummyConstructor(threading.Thread):
rconst
.
VALID_POINT_MASK
:
valid_point_mask
,
},
labels
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
)
data
=
{
movielens
.
USER_COLUMN
:
users
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment