From e08fdd164c4d201021679db71a21ee032c52c4c9 Mon Sep 17 00:00:00 2001 From: LielinJiang <50691816+LielinJiang@users.noreply.github.com> Date: Wed, 9 Jun 2021 14:30:06 +0800 Subject: [PATCH] Add option "verbose" for predict api (#33405) * add option verbose for predict api --- python/paddle/hapi/model.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/python/paddle/hapi/model.py b/python/paddle/hapi/model.py index 40cba4f45d8..e53ab12f841 100644 --- a/python/paddle/hapi/model.py +++ b/python/paddle/hapi/model.py @@ -1831,6 +1831,7 @@ class Model(object): batch_size=1, num_workers=0, stack_outputs=False, + verbose=1, callbacks=None): """ Compute the output predictions on testing data. @@ -1851,7 +1852,10 @@ class Model(object): be a length N list in shape [[X, Y], [X, Y], ....[X, Y]] if stack_outputs is False. stack_outputs as False is used for LoDTensor output situation, it is recommended set as True if outputs contains no LoDTensor. Default: False. + verbose (int): The verbosity mode, should be 0, 1, or 2. 0 = silent, + 1 = progress bar, 2 = one line per batch. Default: 1. callbacks(Callback): A Callback instance, default None. + Returns: list: output of models. @@ -1911,7 +1915,7 @@ class Model(object): self._test_dataloader = test_loader - cbks = config_callbacks(callbacks, model=self, verbose=1) + cbks = config_callbacks(callbacks, model=self, verbose=verbose) test_steps = self._len_data_loader(test_loader) logs = {'steps': test_steps} -- GitLab