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
e0f26727
Commit
e0f26727
authored
Jan 07, 2019
by
Taylor Robie
Browse files
Revert "remove mock to debug kokoro failures"
This reverts commit
63f5827d
.
parent
63f5827d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
official/recommendation/data_test.py
official/recommendation/data_test.py
+5
-10
No files found.
official/recommendation/data_test.py
View file @
e0f26727
...
...
@@ -22,6 +22,7 @@ from collections import defaultdict
import
hashlib
import
os
import
mock
import
numpy
as
np
import
scipy.stats
import
tensorflow
as
tf
...
...
@@ -49,15 +50,12 @@ FRESH_RANDOMNESS_MD5 = "63d0dff73c0e5f1048fbdc8c65021e22"
def
mock_download
(
*
args
,
**
kwargs
):
return
# The forkpool used by data producers interacts badly with the threading
# used by TestCase. Without this patch tests will hang, and no amount
# of diligent closing and joining within the producer will prevent it.
@
mock
.
patch
.
object
(
popen_helper
,
"get_forkpool"
,
popen_helper
.
get_fauxpool
)
class
BaseTest
(
tf
.
test
.
TestCase
):
def
setUp
(
self
):
# The forkpool used by data producers interacts badly with the threading
# used by TestCase. Without this patch tests will hang, and no amount
# of diligent closing and joining within the producer will prevent it.
self
.
_get_forkpool
=
popen_helper
.
get_forkpool
popen_helper
.
get_forkpool
=
popen_helper
.
get_fauxpool
self
.
temp_data_dir
=
self
.
get_temp_dir
()
ratings_folder
=
os
.
path
.
join
(
self
.
temp_data_dir
,
DATASET
)
tf
.
gfile
.
MakeDirs
(
ratings_folder
)
...
...
@@ -95,9 +93,6 @@ class BaseTest(tf.test.TestCase):
data_preprocessing
.
DATASET_TO_NUM_USERS_AND_ITEMS
[
DATASET
]
=
(
NUM_USERS
,
NUM_ITEMS
)
def
tearDown
(
self
):
popen_helper
.
get_forkpool
=
self
.
_get_forkpool
def
make_params
(
self
,
train_epochs
=
1
):
return
{
"train_epochs"
:
train_epochs
,
...
...
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