(self)
| 251 | self.do_forward(network) |
| 252 | |
| 253 | def test_network_by_share(self): |
| 254 | network = LiteNetwork() |
| 255 | network.load(self.model_path) |
| 256 | |
| 257 | input_name = network.get_input_name(0) |
| 258 | input_tensor = network.get_io_tensor(input_name) |
| 259 | output_name = network.get_output_name(0) |
| 260 | output_tensor = network.get_io_tensor(output_name) |
| 261 | |
| 262 | assert input_tensor.device_type == LiteDeviceType.LITE_CPU |
| 263 | layout = LiteLayout(self.input_data.shape, self.input_data.dtype) |
| 264 | tensor_tmp = LiteTensor(layout=layout) |
| 265 | tensor_tmp.set_data_by_share(self.input_data) |
| 266 | input_tensor.share_memory_with(tensor_tmp) |
| 267 | |
| 268 | for i in range(3): |
| 269 | network.forward() |
| 270 | network.wait() |
| 271 | |
| 272 | output_data = output_tensor.to_numpy() |
| 273 | self.check_correct(output_data) |
| 274 | |
| 275 | def test_network_share_weights(self): |
| 276 | option = LiteOptions() |
nothing calls this directly
no test coverage detected