Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update and uncomment keras util tests #6918

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 22 additions & 70 deletions tensorboard/plugins/graph/keras_util_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ def assertGraphDefToModel(self, expected_proto, model):
expected_proto, keras_util.keras_model_to_graph_def(model_config)
)

def DISABLED_test_keras_model_to_graph_def_sequential_model(self):
def test_keras_model_to_graph_def_sequential_model(self):
expected_proto = """
node {
name: "sequential/dense_input"
name: "sequential/input_layer"
attr {
key: "dtype"
value {
Expand All @@ -55,7 +55,7 @@ def DISABLED_test_keras_model_to_graph_def_sequential_model(self):
}
node {
name: "sequential/dense"
input: "sequential/dense_input"
input: "sequential/input_layer"
attr {
key: "dtype"
value {
Expand Down Expand Up @@ -323,42 +323,10 @@ def test_keras_model_to_graph_def_lstm_model(self):
)
self.assertGraphDefToModel(expected_proto, model)

def DISABLED_test_keras_model_to_graph_def_nested_sequential_model(self):
def test_keras_model_to_graph_def_nested_sequential_model(self):
expected_proto = """
node {
name: "sequential_2/sequential_1_input"
attr {
key: "dtype"
value {
type: DT_FLOAT
}
}
attr {
key: "keras_class"
value {
s: "InputLayer"
}
}
}
node {
name: "sequential_2/sequential_1/sequential_input"
input: "sequential_2/sequential_1_input"
attr {
key: "dtype"
value {
type: DT_FLOAT
}
}
attr {
key: "keras_class"
value {
s: "InputLayer"
}
}
}
node {
name: "sequential_2/sequential_1/sequential/dense_input"
input: "sequential_2/sequential_1/sequential_input"
name: "sequential_2/sequential_1/sequential/input_layer"
attr {
key: "dtype"
value {
Expand All @@ -374,7 +342,7 @@ def DISABLED_test_keras_model_to_graph_def_nested_sequential_model(self):
}
node {
name: "sequential_2/sequential_1/sequential/dense"
input: "sequential_2/sequential_1/sequential/dense_input"
input: "sequential_2/sequential_1/sequential/input_layer"
attr {
key: "dtype"
value {
Expand Down Expand Up @@ -786,12 +754,12 @@ def test_keras_model_to_graph_def_functional_model_as_layer(self):

self.assertGraphDefToModel(expected_proto, model)

def DISABLED_test_keras_model_to_graph_def_functional_sequential_model(
def test_keras_model_to_graph_def_functional_sequential_model(
self,
):
expected_proto = """
node {
name: "model/func_seq_input"
name: "functional_1/func_seq_input"
attr {
key: "dtype"
value {
Expand All @@ -806,8 +774,8 @@ def DISABLED_test_keras_model_to_graph_def_functional_sequential_model(
}
}
node {
name: "model/sequential/dense_input"
input: "model/func_seq_input"
name: "functional_1/sequential/input_layer"
input: "functional_1/func_seq_input"
attr {
key: "dtype"
value {
Expand All @@ -822,8 +790,8 @@ def DISABLED_test_keras_model_to_graph_def_functional_sequential_model(
}
}
node {
name: "model/sequential/dense"
input: "model/sequential/dense_input"
name: "functional_1/sequential/dense"
input: "functional_1/sequential/input_layer"
attr {
key: "dtype"
value {
Expand All @@ -838,8 +806,8 @@ def DISABLED_test_keras_model_to_graph_def_functional_sequential_model(
}
}
node {
name: "model/sequential/my_relu"
input: "model/sequential/dense"
name: "functional_1/sequential/my_relu"
input: "functional_1/sequential/dense"
attr {
key: "dtype"
value {
Expand All @@ -854,8 +822,8 @@ def DISABLED_test_keras_model_to_graph_def_functional_sequential_model(
}
}
node {
name: "model/dense_1"
input: "model/sequential/my_relu"
name: "functional_1/dense_1"
input: "functional_1/sequential/my_relu"
attr {
key: "dtype"
value {
Expand Down Expand Up @@ -885,27 +853,12 @@ def DISABLED_test_keras_model_to_graph_def_functional_sequential_model(

self.assertGraphDefToModel(expected_proto, model)

def DISABLED_test_keras_model_to_graph_def_sequential_functional_model(
def test_keras_model_to_graph_def_sequential_functional_model(
self,
):
expected_proto = """
node {
name: "sequential/model_input"
attr {
key: "dtype"
value {
type: DT_FLOAT
}
}
attr {
key: "keras_class"
value {
s: "InputLayer"
}
}
}
node {
name: "sequential/model/func_seq_input"
name: "sequential/functional/func_seq_input"
attr {
key: "dtype"
value {
Expand All @@ -920,8 +873,8 @@ def DISABLED_test_keras_model_to_graph_def_sequential_functional_model(
}
}
node {
name: "sequential/model/dense"
input: "sequential/model/func_seq_input"
name: "sequential/functional/dense"
input: "sequential/functional/func_seq_input"
attr {
key: "dtype"
value {
Expand All @@ -937,7 +890,7 @@ def DISABLED_test_keras_model_to_graph_def_sequential_functional_model(
}
node {
name: "sequential/dense_1"
input: "sequential/model/dense"
input: "sequential/functional/dense"
attr {
key: "dtype"
value {
Expand Down Expand Up @@ -982,8 +935,7 @@ def DISABLED_test_keras_model_to_graph_def_sequential_functional_model(

self.assertGraphDefToModel(expected_proto, model)

# Enable after next sync to internal repo from Keras team.
def DISABLED_test_keras_model_to_graph_def_functional_multiple_inbound_nodes_from_same_node(
def test_keras_model_to_graph_def_functional_multiple_inbound_nodes_from_same_node(
self,
):
expected_proto = """
Expand Down
Loading