MCPcopy Index your code
hub / github.com/tensorflow/hub / testSignatures

Method testSignatures

tensorflow_hub/saved_model_lib_test.py:170–186  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

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:

Callers

nothing calls this directly

Calls 2

add_graph_copyMethod · 0.95
get_meta_graph_copyMethod · 0.95

Tested by

no test coverage detected