Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

fix format_err_str function in mytorch.py #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion co/mytorch.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,10 @@ def get_eval_data_loader(self, dset):
def format_err_str(self, errs, div=1):
err_list = []
for v in errs.values():
if isinstance(v, (list, np.ndarray)):
if isinstance(v, np.ndarray):
err_list.extend(v.ravel())
elif isinstance(v, list):
v=np.array(v)
err_list.extend(v.ravel())
else:
err_list.append(v)
Expand Down