Skip to content

Commit f752e81

Browse files
authored
Update util.py
add to_csv
1 parent 0ef516a commit f752e81

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

util.py

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
import torch.nn.functional as F
99
import torchvision.models as models
1010

11+
def to_csv(np_arr):
12+
s = StringIO()
13+
np.savetxt(s, np_arr, fmt='%s', newline=",")
14+
return s.getvalue()[:-1]
1115

1216
def download_url(url, destination=None, progress_bar=True):
1317
"""Download a URL to a local file.

0 commit comments

Comments
 (0)