Commit a409e623 authored by VIOLANTE Nicolas's avatar VIOLANTE Nicolas
Browse files

add case for tensor

parent 69eff429
......@@ -725,5 +725,7 @@ def to_npy(tensor):
"""
if isinstance(tensor, np.ndarray):
return tensor
elif isinstance(tensor, list):
return np.array(tensor)
else:
return tensor.data.cpu().numpy()
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment