MCPcopy Index your code
hub / github.com/tensorflow/models / TestModule

Class TestModule

official/core/export_base_test.py:24–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22
23
24class TestModule(export_base.ExportModule):
25
26 @tf.function
27 def serve(self, inputs: tf.Tensor) -> Mapping[Text, tf.Tensor]:
28 x = inputs if self.preprocessor is None else self.preprocessor(
29 inputs=inputs)
30 x = self.inference_step(x)
31 x = self.postprocessor(x) if self.postprocessor else x
32 return {'outputs': x}
33
34 def get_inference_signatures(
35 self, function_keys: Dict[Text, Text]) -> Mapping[Text, Any]:
36 input_signature = tf.TensorSpec(shape=[None, None], dtype=tf.float32)
37 return {'foo': self.serve.get_concrete_function(input_signature)}
38
39
40class ExportBaseTest(tf.test.TestCase):

Callers 3

test_export_moduleMethod · 0.85
test_processorsMethod · 0.85

Calls

no outgoing calls

Tested by 3

test_export_moduleMethod · 0.68
test_processorsMethod · 0.68