Skip to content

Commit

Permalink
fix(torch): segmentation with test_batch_size > 1
Browse files Browse the repository at this point in the history
  • Loading branch information
royale committed Jul 19, 2024
1 parent 8bc5b97 commit 0d8d3da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backends/torch/torchlib.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2242,7 +2242,7 @@ namespace dd
output = torch::softmax(output, 1);
torch::Tensor target = batch.target.at(0).to(torch::kFloat64);
torch::Tensor segmap
= torch::flatten(torch::argmax(output.squeeze(), 0))
= torch::flatten(torch::argmax(output.squeeze(), 1))
.contiguous()
.to(torch::kFloat64)
.to(cpu); // squeeze removes the batch size
Expand Down

0 comments on commit 0d8d3da

Please sign in to comment.