Skip to content

Commit 8263b0e

Browse files
ign-ssunilign-krishnanand
authored andcommitted
Fixed ssr demo file
1 parent 3558057 commit 8263b0e

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

models/experimental/SSR/demo/ssr_demo.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ def save_tensor_as_image(tensor, output_path):
5555
if tensor.dim() == 4:
5656
tensor = tensor.squeeze(0) # Remove batch dimension
5757

58+
# Convert BFloat16 to Float32 if needed
59+
if tensor.dtype == torch.bfloat16:
60+
tensor = tensor.to(torch.float32)
61+
5862
# Clamp values to [0, 1] range
5963
tensor = torch.clamp(tensor, 0, 1)
6064

0 commit comments

Comments
 (0)