Skip to content

Commit 4d146c8

Browse files
authored
Added assert statements to track default tensors saved in ZCC (aws#228)
Added assert statements to track default tensors saved in ZCC Assert statements have intentionally not been added to the grad tape test because no tensors are saved in ZCC and creating a trial will create a an infinite wait.
1 parent 1053ee5 commit 4d146c8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

tests/zero_code_change/tensorflow2_integration_tests.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
# First Party
2424
import smdebug.tensorflow as smd
25+
from smdebug.core.collection import CollectionKeys
2526
from smdebug.core.utils import SagemakerSimulator
2627

2728

@@ -80,7 +81,16 @@ def helper_test_keras_v2(script_mode: bool = False, eager_mode: bool = True):
8081
trial = smd.create_trial(path=sim.out_dir)
8182
assert len(trial.steps()) > 0, "Nothing saved at any step."
8283
assert len(trial.tensor_names()) > 0, "Tensors were not saved."
83-
assert len(trial.tensor_names(collection="losses")) > 0
84+
85+
# DEFAULT TENSORS SAVED
86+
assert len(trial.tensor_names(collection=CollectionKeys.LOSSES)) > 0, "No Losses Saved"
87+
assert len(trial.tensor_names(collection=CollectionKeys.METRICS)) > 0, "No Metrics Saved"
88+
assert (
89+
len(trial.tensor_names(collection=CollectionKeys.WEIGHTS)) == 0
90+
), "Weights were not expected to be saved by default"
91+
assert (
92+
len(trial.tensor_names(collection=CollectionKeys.BIASES)) == 0
93+
), "Biases were not expected to be saved by default"
8494

8595

8696
def helper_test_keras_v2_json_config(

0 commit comments

Comments
 (0)