-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
26 additions
and
30 deletions.
There are no files selected for viewing
18 changes: 8 additions & 10 deletions
18
tensorflow_recommenders_addons/dynamic_embedding/python/keras/callbacks_test.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,13 @@ | ||
import pytest | ||
from tensorflow.python.framework import test_util | ||
|
||
from tensorflow_recommenders_addons.dynamic_embedding.python.keras.callbacks import \ | ||
DEHvdBroadcastGlobalVariablesCallback | ||
|
||
|
||
@pytest.fixture | ||
def broadcast_callback(root_rank=0, device='/gpu:0'): | ||
# Instantiate with the corrected parameters | ||
return DEHvdBroadcastGlobalVariablesCallback(root_rank=root_rank, | ||
device=device) | ||
|
||
|
||
def test_on_batch_end_subsequent_calls(broadcast_callback): | ||
broadcast_callback.broadcast_done = True | ||
broadcast_callback.on_batch_end(1) | ||
def test_on_batch_end_subsequent_calls(): | ||
if test_util.is_gpu_available(): | ||
broadcast_callback = DEHvdBroadcastGlobalVariablesCallback(root_rank=0, | ||
device='/gpu:0') | ||
broadcast_callback.broadcast_done = True | ||
broadcast_callback.on_batch_end(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters