我正在尝试使用 protobuf 序列化火炬张量,但似乎使用BytesIOwithtorch.save()不起作用。我努力了:
import torch
import io
x = torch.randn(size=(1,20))
buff = io.BytesIO()
torch.save(x, buff)
print(f'buffer: {buff.read()}')
无济于事,因为它会导致b''输出!我该怎么办?
千万里不及你
holdtom
慕的地8271018
一只名叫tom的猫
随时随地看视频慕课网APP
相关分类