Skip to content

Commit

Permalink
Remove debug print statement and ensure tensor type conversion in Pat…
Browse files Browse the repository at this point in the history
…chInferencerEngine and ResizedMetric
  • Loading branch information
GabrielBG0 committed Nov 12, 2024
1 parent b4018be commit a0078dd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion minerva/analysis/metrics/transformed_metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,5 +177,5 @@ def resize(self, x: torch.Tensor) -> torch.Tensor:
elif self.target_w_size is None:
scale = target_h_size / h
target_w_size = int(w * scale)

x = x.to(torch.uint8) if x.type() == "torch.LongTensor" else x
return torch.nn.functional.interpolate(x, size=(target_h_size, target_w_size))
1 change: 0 additions & 1 deletion minerva/engines/patch_inferencer_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ def _combine_patches(
)
reconstructed.append(reconstruct)
weights.append(weight)
print(reconstruct.shape)
reconstructed = torch.stack(reconstructed, dim=0)
weights = torch.stack(weights, dim=0)
return torch.sum(reconstructed * weights, dim=0) / torch.sum(weights, dim=0)
Expand Down

0 comments on commit a0078dd

Please sign in to comment.