mirror of
https://github.com/wassname/seq2seq-time.git
synced 2026-07-29 11:27:12 +08:00
dataloading
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user