Create a TensorFlow SavedModel for testing. Args: save_path: The directory path in which to save the model.
(save_path)
| 109 | builder.save() |
| 110 | |
| 111 | def _createTensorFlowSavedModel(save_path): |
| 112 | """Create a TensorFlow SavedModel for testing. |
| 113 | |
| 114 | Args: |
| 115 | save_path: The directory path in which to save the model. |
| 116 | """ |
| 117 | |
| 118 | input_data = constant_op.constant(1., shape=[1]) |
| 119 | root = autotrackable.AutoTrackable() |
| 120 | root.v1 = variables.Variable(3.) |
| 121 | root.v2 = variables.Variable(2.) |
| 122 | root.f = def_function.function(lambda x: root.v1 * root.v2 * x) |
| 123 | to_save = root.f.get_concrete_function(input_data) |
| 124 | |
| 125 | save(root, save_path, to_save) |
| 126 | |
| 127 | |
| 128 | def _create_hub_module(save_path): |
no outgoing calls
no test coverage detected
searching dependent graphs…