Skip to content

Commit d271fbe

Browse files
authored
Modify Should Save Tensor Test To Work on Any Version of TF (aws#352)
1 parent 82729b1 commit d271fbe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/tensorflow2/test_should_save_tensor.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# First Party
55
import smdebug.tensorflow as smd
66
from smdebug.core.collection import CollectionKeys
7+
from smdebug.core.modes import ModeKeys
78
from smdebug.tensorflow import SaveConfig
89
from smdebug.tensorflow.constants import TF_DEFAULT_SAVED_COLLECTIONS
910

@@ -27,6 +28,9 @@ def helper_create_hook(out_dir, collections, include_regex=None):
2728
hook.get_collection(collection).include(include_regex)
2829

2930
hook.register_model(model)
31+
hook.set_mode(ModeKeys.TRAIN)
32+
hook._prepare_collections()
33+
hook._increment_step()
3034
hook.on_train_begin()
3135
return hook
3236

0 commit comments

Comments
 (0)