(self, input: Input, *args, **kwargs)
| 270 | return collate_fn(data, self.device) |
| 271 | |
| 272 | def _process_single(self, input: Input, *args, **kwargs) -> Dict[str, Any]: |
| 273 | preprocess_params = kwargs.get('preprocess_params', {}) |
| 274 | forward_params = kwargs.get('forward_params', {}) |
| 275 | postprocess_params = kwargs.get('postprocess_params', {}) |
| 276 | self._check_input(input) |
| 277 | out = self.preprocess(input, **preprocess_params) |
| 278 | |
| 279 | with device_placement(self.framework, self.device_name): |
| 280 | if self.framework == Frameworks.torch: |
| 281 | with torch.no_grad(): |
| 282 | if self._auto_collate: |
| 283 | out = self._collate_fn(out) |
| 284 | out = self.forward(out, **forward_params) |
| 285 | else: |
| 286 | out = self.forward(out, **forward_params) |
| 287 | |
| 288 | out = self.postprocess(out, **postprocess_params) |
| 289 | self._check_output(out) |
| 290 | return out |
| 291 | |
| 292 | def _batch(self, data_list): |
| 293 | batch_data = {} |
no test coverage detected