Skip to content

Commit

Permalink
fix bug in eval.py
Browse files Browse the repository at this point in the history
  • Loading branch information
HydrogenSulfate committed Sep 26, 2023
1 parent f242756 commit 031f210
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ppsci/solver/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,17 +156,17 @@ def _eval_by_dataset(

# concate all data and discard padded sample(s)
for key in all_input:
if paddle.is_tensor(all_input[key]):
if paddle.is_tensor(all_input[key][0]):
all_input[key] = paddle.concat(all_input[key])
if len(all_input[key]) > num_samples:
all_input[key] = all_input[key][:num_samples]
for key in all_output:
if paddle.is_tensor(all_input[key]):
if paddle.is_tensor(all_output[key][0]):
all_output[key] = paddle.concat(all_output[key])
if len(all_output[key]) > num_samples:
all_output[key] = all_output[key][:num_samples]
for key in all_label:
if paddle.is_tensor(all_input[key]):
if paddle.is_tensor(all_label[key][0]):
all_label[key] = paddle.concat(all_label[key])
if len(all_label[key]) > num_samples:
all_label[key] = all_label[key][:num_samples]
Expand Down

0 comments on commit 031f210

Please sign in to comment.