Loading...
Searching...
No Matches
torch2Eigen.H File Reference

Header file of the torch2Eigen namespace. More...

#include <iostream>
#include <torch/script.h>
#include <torch/torch.h>
#include <Eigen/Eigen>
#include "ITHACAassert.H"

Go to the source code of this file.

Functions

template<class type>
torch::Tensor ITHACAtorch::torch2Eigen::eigenMatrix2torchTensor (Eigen::Matrix< type, Eigen::Dynamic, Eigen::Dynamic > eigenMatrix)
 Convert an eigen Matrix to a torch tensor.
template<class type>
Eigen::Matrix< type, Eigen::Dynamic, Eigen::Dynamic > ITHACAtorch::torch2Eigen::torchTensor2eigenMatrix (torch::Tensor &torchTensor)
 Convert a torch tensor to an eigen Matrix.

Detailed Description

Header file of the torch2Eigen namespace.

It contains functions to

Definition in file torch2Eigen.H.

Function Documentation

◆ eigenMatrix2torchTensor()

template<class type>
torch::Tensor ITHACAtorch::torch2Eigen::eigenMatrix2torchTensor ( Eigen::Matrix< type, Eigen::Dynamic, Eigen::Dynamic > eigenMatrix)

Convert an eigen Matrix to a torch tensor.

Parameters
[in]eigenMatrixThe eigen matrix
Template Parameters
typeCan be double, float, int
Returns
a matrix in Eigen float format

Definition at line 39 of file torch2Eigen.C.

◆ torchTensor2eigenMatrix()

template<class type>
Eigen::Matrix< type, Eigen::Dynamic, Eigen::Dynamic > ITHACAtorch::torch2Eigen::torchTensor2eigenMatrix ( torch::Tensor & torchTensor)

Convert a torch tensor to an eigen Matrix.

Parameters
torchTensorThe torch tensor
Template Parameters
typeCan be double, float, int
Returns
a torch tensor

Definition at line 55 of file torch2Eigen.C.