(self)
| 168 | self.assertCountEqual(asset_tensor_names, asset_tensor_names) |
| 169 | |
| 170 | def testSignatures(self): |
| 171 | with tf.Graph().as_default() as graph: |
| 172 | input_a = tf.constant(2) |
| 173 | input_b = tf.constant(3) |
| 174 | mul = input_a * input_b |
| 175 | saved_model_lib.add_signature("six", {}, {"out": mul}) |
| 176 | saved_model_lib.add_signature("mul2", {"in": input_b}, {"out": mul}) |
| 177 | |
| 178 | handler = saved_model_lib.SavedModelHandler() |
| 179 | handler.add_graph_copy(graph) |
| 180 | |
| 181 | signatures = handler.get_meta_graph_copy().signature_def |
| 182 | self.assertEqual(set(signatures.keys()), set(["six", "mul2"])) |
| 183 | self.assertAllEqual(list(signatures["six"].inputs.keys()), []) |
| 184 | self.assertAllEqual(list(signatures["six"].outputs.keys()), ["out"]) |
| 185 | self.assertAllEqual(list(signatures["mul2"].inputs.keys()), ["in"]) |
| 186 | self.assertAllEqual(list(signatures["mul2"].outputs.keys()), ["out"]) |
| 187 | |
| 188 | def testSignatureImplementationIsInvisible(self): |
| 189 | with tf.Graph().as_default() as graph: |
nothing calls this directly
no test coverage detected