未验证 提交 6c81cc35 编写于 作者: H Hecong Wu 提交者: GitHub

fix a wrong type judgment of `make_grid` (#120)

上级 f0475673
...@@ -34,7 +34,7 @@ def make_grid(tensor, nrow=8, normalize=False, range=None, scale_each=False): ...@@ -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``. images separately rather than the (min, max) over all images. Default: ``False``.
""" """
if not (isinstance(tensor, paddle.Tensor) or 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))) raise TypeError('tensor or list of tensors expected, got {}'.format(type(tensor)))
# if list of tensors, convert to a 4D mini-batch Tensor # if list of tensors, convert to a 4D mini-batch Tensor
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册