Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug-fixes] replace concat with stack for 0d tensor #3356

Merged
merged 1 commit into from
Jul 5, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions paddleseg/utils/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def calculate_area(pred, label, num_classes, ignore_index=255):
label_area.append(paddle.sum(paddle.cast(label_i, "int64")))
intersect_area.append(paddle.sum(paddle.cast(intersect_i, "int64")))

pred_area = paddle.concat(pred_area)
label_area = paddle.concat(label_area)
intersect_area = paddle.concat(intersect_area)
pred_area = paddle.stack(pred_area)
label_area = paddle.stack(label_area)
intersect_area = paddle.stack(intersect_area)

return intersect_area, pred_area, label_area

Expand Down