10 #ifdef LIBTORCH_ENABLED 14 #include <torch/torch.h> 27 template <
typename DataType>
29 vectorToTensor(std::vector<DataType> & vector, torch::Tensor & tensor,
const bool detach =
false);
37 template <
typename DataType>
38 void tensorToVector(torch::Tensor & tensor, std::vector<DataType> & vector);
void tensorToVector(torch::Tensor &tensor, std::vector< DataType > &vector)
Utility function that converts a torch::Tensor to a standard vector.
void vectorToTensor(std::vector< DataType > &vector, torch::Tensor &tensor, const bool detach=false)
Utility function that converts a standard vector to a torch::Tensor.