mirror of
https://github.com/vladmandic/automatic
synced 2026-08-28 16:11:02 +02:00
fix tensor to np
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user