candle
candle copied to clipboard
Is there a way to zero-copy `tch-rs::Tensor` as `candle_core::Tensor`?
I am working on some project that started as tch-rs, and would like to know if there is any way to convert a tch-rs::Tensor as a candle_core::Tensor? preferably zero-copy?
I don't think there is anything no-copy possible at the moment, you would have to extract the whole content of the tch tensor and then create a new candle tensor with Tensor::from_vec.
Thank you for taking the time to reply.
Yeah that's what I thought... I did try to extract everything one by one, but honestly it was much faster to save the tch::Tensor to disk first and then load the candle_core::Tensor using mmap. But I was wondering if I there was another more "graceful" and efficient solution.