(self)
| 1146 | self.assertTrue(([1, 16, 16, 3] == input_details[0]['shape']).all()) |
| 1147 | |
| 1148 | def testFreezeGraph(self): |
| 1149 | with ops.Graph().as_default(): |
| 1150 | in_tensor = array_ops.placeholder( |
| 1151 | shape=[1, 16, 16, 3], dtype=dtypes.float32) |
| 1152 | var = variable_scope.get_variable( |
| 1153 | 'weights', shape=[1, 16, 16, 3], dtype=dtypes.float32) |
| 1154 | _ = in_tensor + var |
| 1155 | sess = session.Session() |
| 1156 | |
| 1157 | # Write graph to file. |
| 1158 | graph_def_file = os.path.join(self.get_temp_dir(), 'model.pb') |
| 1159 | write_graph(sess.graph_def, '', graph_def_file, False) |
| 1160 | sess.close() |
| 1161 | |
| 1162 | # Ensure the graph with variables cannot be converted. |
| 1163 | with self.assertRaises(ValueError) as error: |
| 1164 | lite.TFLiteConverter.from_frozen_graph(graph_def_file, ['Placeholder'], |
| 1165 | ['add']) |
| 1166 | self.assertEqual('Please freeze the graph using freeze_graph.py.', |
| 1167 | str(error.exception)) |
| 1168 | |
| 1169 | def testPbtxt(self): |
| 1170 | with ops.Graph().as_default(): |
nothing calls this directly
no test coverage detected