fix tensor to np

pull/2631/head
Vladimir Mandic 2023-12-10 18:06:07 -05:00
parent 4823595dc9
commit d71287e068
3 changed files with 3 additions and 3 deletions

@ -1 +1 @@
Subproject commit 96dbc601a6c880571d3a2a1314052d0922114604
Subproject commit 0d0841671ef165d6d408f7b9cd6bfb1dda3d78cf

@ -1 +1 @@
Subproject commit 08fc2647f1fe413699612df923b5f495d26853ef
Subproject commit 323ce7efef3e3f67b11c09c9e7fa3567d293b048

View File

@ -757,7 +757,7 @@ def validate_sample(tensor):
sample = 255.0 * np.moveaxis(tensor.cpu().numpy(), 0, 2)
else:
sample = 255.0 * tensor
if isinstance(tensor, torch.Tensor):
if isinstance(tensor, torch.Tensor) and hasattr(tensor, 'detach'):
sample = sample.detach().cpu().numpy()
with warnings.catch_warnings(record=True) as w:
cast = sample.astype(np.uint8)