diff options
author | 2017-12-12 10:58:31 -0800 | |
---|---|---|
committer | 2017-12-12 11:02:23 -0800 | |
commit | 968da4bf2722b1303cc223e8342357d62c27dfc1 (patch) | |
tree | dab12578913f6bfc11b50d92f39ae95fd7301963 /tensorflow/c/c_api_test.cc | |
parent | c8a5ffdeb2a17df2d2822c7a6df8a44f3ab85614 (diff) |
Raise exception on missing unused input_map keys with C API enabled.
Without this change, the C++ ImportGraphDef API returns unused
input_map keys (which are plumbed through to the C API as
well). However, the Python import_graph_def API requires slightly
different semantics: it throws an error for unused input_map keys that
are missing from the GraphDef.
This change modifies the C and C++ APIs to limit the returned keys to
those missing from the GraphDef, and plumbs this through to the C
API-enabled import_graph_def implementation.
Note that this is a change to the existing C API. Luckily the modified
method hasn't been released yet, so it's ok to change it.
PiperOrigin-RevId: 178783957
Diffstat (limited to 'tensorflow/c/c_api_test.cc')
-rw-r--r-- | tensorflow/c/c_api_test.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tensorflow/c/c_api_test.cc b/tensorflow/c/c_api_test.cc index 6ec1db8ccf..4e89b4fc43 100644 --- a/tensorflow/c/c_api_test.cc +++ b/tensorflow/c/c_api_test.cc @@ -773,7 +773,7 @@ TEST(CAPI, ImportGraphDef_WithReturnOutputs) { TF_DeleteStatus(s); } -TEST(CAPI, ImportGraphDef_UnusedInputMappings) { +TEST(CAPI, ImportGraphDef_MissingUnusedInputMappings) { TF_Status* s = TF_NewStatus(); TF_Graph* graph = TF_NewGraph(); @@ -816,7 +816,7 @@ TEST(CAPI, ImportGraphDef_UnusedInputMappings) { int num_unused_input_mappings; const char** src_names; int* src_indexes; - TF_ImportGraphDefResultsUnusedInputMappings( + TF_ImportGraphDefResultsMissingUnusedInputMappings( results, &num_unused_input_mappings, &src_names, &src_indexes); ASSERT_EQ(1, num_unused_input_mappings); EXPECT_EQ(string("fake"), string(src_names[0])); |