From 6c81cc35ecfff2da287d3d25c521ae0c1f49fc95 Mon Sep 17 00:00:00 2001 From: Hecong Wu Date: Fri, 11 Dec 2020 08:35:56 -0600 Subject: [PATCH] fix a wrong type judgment of `make_grid` (#120) --- ppgan/utils/visual.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ppgan/utils/visual.py b/ppgan/utils/visual.py index 1380638..ee20739 100644 --- a/ppgan/utils/visual.py +++ b/ppgan/utils/visual.py @@ -34,7 +34,7 @@ def make_grid(tensor, nrow=8, normalize=False, range=None, scale_each=False): images separately rather than the (min, max) over all images. Default: ``False``. """ if not (isinstance(tensor, paddle.Tensor) or - (isinstance(tensor, list) and all(isinstance(tensor, t) for t in tensor))): + (isinstance(tensor, list) and all(isinstance(t, paddle.Tensor) for t in tensor))): raise TypeError('tensor or list of tensors expected, got {}'.format(type(tensor))) # if list of tensors, convert to a 4D mini-batch Tensor -- GitLab