mirror of
https://github.com/huggingface/candle.git
synced 2025-06-16 18:48:51 +00:00
9 lines
185 B
Python
9 lines
185 B
Python
import torch
|
|
from collections import OrderedDict
|
|
|
|
# Write a trivial tensor to a pt file
|
|
a= torch.tensor([[1,2,3,4], [5,6,7,8]])
|
|
o = OrderedDict()
|
|
o["test"] = a
|
|
torch.save(o, "test.pt")
|