Open med1844 opened 1 month ago
Issue based on discussion #2315, @antimora
To my best knowledge, here's how to load a tensor:
In python: Ensure you wrap the tensor with dict before save, e.g.
torch.save({"some_key": tensor}, "path/to/tensor.pt")
In rust:
#[derive(Module, Debug)] struct FloatTensor<B: Backend, const D: usize> { some_key: Param<Tensor<B, D>>, } fn main() { type B = NdArray; let device = Default::default(); let tensor: FloatTensorRecord<B, 3> = PyTorchFileRecorder::<FullPrecisionSettings>::new() .load("path/to/tensor.pt".into(), &device) .unwrap(); let tensor = tensor.value.val(); }
Hi, could I take up this issue?
Yes! Please go ahead. We would appreciate your contribution. Let me know if you need more info.
Issue based on discussion #2315, @antimora
To my best knowledge, here's how to load a tensor:
In python: Ensure you wrap the tensor with dict before save, e.g.
In rust: