MCPcopy Create free account
hub / github.com/PaddlePaddle/Paddle / predict_batch

Method predict_batch

python/paddle/hapi/model.py:1353–1362  ·  view source on GitHub ↗
(self, inputs)

Source from the content-addressed store, hash-verified

1351 return metrics
1352
1353 def predict_batch(self, inputs):
1354 self.model.network.eval()
1355 self.mode = 'test'
1356 inputs = [paddle.to_tensor(x) for x in to_list(inputs)]
1357 self._input_info = _update_input_info(inputs)
1358 outputs = self.model.network(*inputs)
1359 if self._nranks > 1 and isinstance(self.model._place, base.CUDAPlace):
1360 outputs = [_all_gather(o) for o in to_list(outputs)]
1361
1362 return [to_numpy(o) for o in to_list(outputs)]
1363
1364 def parameters(self, *args, **kwargs):
1365 return self.model.network.parameters(*args, **kwargs)

Callers

nothing calls this directly

Calls 7

_update_input_infoFunction · 0.85
to_tensorMethod · 0.80
to_listFunction · 0.70
_all_gatherFunction · 0.70
to_numpyFunction · 0.70
evalMethod · 0.45
networkMethod · 0.45

Tested by

no test coverage detected