(self)
| 304 | self.do_forward(new_network) |
| 305 | |
| 306 | def test_network_async(self): |
| 307 | count = 0 |
| 308 | finished = False |
| 309 | |
| 310 | def async_callback(): |
| 311 | nonlocal finished |
| 312 | finished = True |
| 313 | return 0 |
| 314 | |
| 315 | option = LiteOptions() |
| 316 | option.var_sanity_check_first_run = 0 |
| 317 | config = LiteConfig(option=option) |
| 318 | |
| 319 | network = LiteNetwork(config=config) |
| 320 | network.load(self.model_path) |
| 321 | |
| 322 | network.async_with_callback(async_callback) |
| 323 | |
| 324 | input_tensor = network.get_io_tensor(network.get_input_name(0)) |
| 325 | output_tensor = network.get_io_tensor(network.get_output_name(0)) |
| 326 | |
| 327 | input_tensor.set_data_by_share(self.input_data) |
| 328 | network.forward() |
| 329 | |
| 330 | while not finished: |
| 331 | count += 1 |
| 332 | |
| 333 | assert count > 0 |
| 334 | output_data = output_tensor.to_numpy() |
| 335 | self.check_correct(output_data) |
| 336 | |
| 337 | def test_network_start_callback(self): |
| 338 | network = LiteNetwork() |
nothing calls this directly
no test coverage detected