在用ais_bench.infer.interface.InferSession进行离线推理,输入到run中的数据都是numpy()类型,运行完run之后,获取到的数据类型却为tensor,打印出来显示如下:
<Tensor>
shape: (1, 256, 768)
dtype: float32
device: 0
用torch.save保存,又会出现报错:TypeError: cannot pickle 'aclruntime.Tensor' object。应该如何获取tensor里面的数据呢?
在用ais_bench.infer.interface.InferSession进行离线推理,输入到run中的数据都是numpy()类型,运行完run之后,获取到的数据类型却为tensor,打印出来显示如下:
<Tensor>
shape: (1, 256, 768)
dtype: float32
device: 0
用torch.save保存,又会出现报错:TypeError: cannot pickle 'aclruntime.Tensor' object。应该如何获取tensor里面的数据呢?