pytorch-cpp icon indicating copy to clipboard operation
pytorch-cpp copied to clipboard

Conversion from float std::vector to Aten Tensor and vice versa?

Open kirill-pinigin opened this issue 6 years ago • 1 comments

Conversion from float std::vector to Aten Tensor and vice versa?

kirill-pinigin avatar Jun 07 '18 12:06 kirill-pinigin

@kirill-pinigin Providing the .data() output of a vector to a tensorFromBlob() function should work. Not really relevant but close example: https://github.com/warmspringwinds/pytorch-cpp/blob/master/examples/read_allocated_gpu_memory.cpp#L64

warmspringwinds avatar Jun 20 '18 22:06 warmspringwinds