Checks that the input map in a signature def is populated correctly.
| 113 | |
| 114 | // Checks that the input map in a signature def is populated correctly. |
| 115 | TEST(BundleShimTest, AddInputToSignatureDef) { |
| 116 | SignatureDef signature_def; |
| 117 | const string tensor_name = "foo_tensor"; |
| 118 | const string map_key = "foo_key"; |
| 119 | |
| 120 | // Build a map of tensor-name to dtype, for the unit-test. |
| 121 | std::unordered_map<string, DataType> tensor_name_to_dtype; |
| 122 | tensor_name_to_dtype[tensor_name] = tensorflow::DT_STRING; |
| 123 | |
| 124 | AddInputToSignatureDef(tensor_name, tensor_name_to_dtype, map_key, |
| 125 | &signature_def); |
| 126 | EXPECT_EQ(1, signature_def.inputs_size()); |
| 127 | EXPECT_EQ(tensor_name, signature_def.inputs().find(map_key)->second.name()); |
| 128 | } |
| 129 | |
| 130 | // Checks that the output map in a signature def is populated correctly. |
| 131 | TEST(BundleShimTest, AddOutputToSignatureDef) { |
nothing calls this directly
no test coverage detected