dataloading

This commit is contained in:
wassname
2020-10-18 13:12:09 +08:00
parent 7ab5c56bf2
commit 279ef54d86
11 changed files with 2497 additions and 2481 deletions
+10
View File
@@ -0,0 +1,10 @@
from pathlib import Path
import torch
project_dir = Path(__file__).parent.parent
def to_numpy(x):
"""Helper function to avoid repeating code"""
if isinstance(x, torch.Tensor):
x = x.cpu().detach().numpy()
return x