LIMA
Libre Multilingual Analyzer — C++ API
Loading...
Searching...
No Matches
deeplima::TorchMatrix< T > Class Template Reference

#include <deeplima/torch_wrp/torch_matrix.h>

Public Types

typedef T value_t
 
typedef torch::Tensor tensor_t
 

Public Member Functions

 TorchMatrix ()
 
 TorchMatrix (int64_t max_time, int64_t max_feat)
 
 TorchMatrix (torch::Tensor input, int64_t start_time, int64_t max_time)
 
void init (int64_t max_time, int64_t max_feat)
 
void set (int64_t time, uint64_t feat, T value)
 
uint64_t get (uint64_t time, uint64_t feat)
 
uint64_t size () const
 
uint64_t get_max_feat () const
 
const torch::Tensor & get_tensor () const
 
void to (torch::Device &device)
 

Protected Member Functions

void create ()
 
torch::Tensor create_empty_tensor ()
 
torch::Tensor create_tensor (int64_t max_time, int64_t max_feat)
 
torch::Tensor create_tensor (int64_t max_time, int64_t max_feat)
 
torch::Tensor create_tensor (int64_t max_time, int64_t max_feat)
 
void create ()
 
void create ()
 

Protected Attributes

int64_t m_start_time
 
int64_t m_max_time
 
int64_t m_max_feat
 
torch::Tensor m_tensor
 
torch::TensorAccessor< T, 2 > m_accessor
 

Detailed Description

template<class T>
class deeplima::TorchMatrix< T >

Definition at line 15 of file torch_matrix.h.

Member Typedef Documentation

◆ tensor_t

template<class T >
typedef torch::Tensor deeplima::TorchMatrix< T >::tensor_t

Definition at line 19 of file torch_matrix.h.

◆ value_t

template<class T >
typedef T deeplima::TorchMatrix< T >::value_t

Definition at line 18 of file torch_matrix.h.

Constructor & Destructor Documentation

◆ TorchMatrix() [1/3]

template<class T >
deeplima::TorchMatrix< T >::TorchMatrix ( )
inline

Definition at line 21 of file torch_matrix.h.

◆ TorchMatrix() [2/3]

template<class T >
deeplima::TorchMatrix< T >::TorchMatrix ( int64_t  max_time,
int64_t  max_feat 
)
inline

Definition at line 29 of file torch_matrix.h.

◆ TorchMatrix() [3/3]

template<class T >
deeplima::TorchMatrix< T >::TorchMatrix ( torch::Tensor  input,
int64_t  start_time,
int64_t  max_time 
)
inline

Definition at line 42 of file torch_matrix.h.

Member Function Documentation

◆ create() [1/3]

template<class T >
void deeplima::TorchMatrix< T >::create ( )
protected

◆ create() [2/3]

void deeplima::TorchMatrix< int64_t >::create ( )
inlineprotected

Definition at line 161 of file torch_matrix.h.

◆ create() [3/3]

void deeplima::TorchMatrix< float >::create ( )
inlineprotected

Definition at line 171 of file torch_matrix.h.

◆ create_empty_tensor()

template<class T >
torch::Tensor deeplima::TorchMatrix< T >::create_empty_tensor ( )
inlineprotected

Definition at line 110 of file torch_matrix.h.

◆ create_tensor() [1/3]

template<class T >
torch::Tensor deeplima::TorchMatrix< T >::create_tensor ( int64_t  max_time,
int64_t  max_feat 
)
protected

◆ create_tensor() [2/3]

torch::Tensor deeplima::TorchMatrix< int64_t >::create_tensor ( int64_t  max_time,
int64_t  max_feat 
)
inlineprotected

Definition at line 125 of file torch_matrix.h.

◆ create_tensor() [3/3]

torch::Tensor deeplima::TorchMatrix< float >::create_tensor ( int64_t  max_time,
int64_t  max_feat 
)
inlineprotected

Definition at line 134 of file torch_matrix.h.

◆ get()

template<class T >
uint64_t deeplima::TorchMatrix< T >::get ( uint64_t  time,
uint64_t  feat 
)
inline

Definition at line 79 of file torch_matrix.h.

◆ get_max_feat()

template<class T >
uint64_t deeplima::TorchMatrix< T >::get_max_feat ( ) const
inline

Definition at line 92 of file torch_matrix.h.

◆ get_tensor()

template<class T >
const torch::Tensor & deeplima::TorchMatrix< T >::get_tensor ( ) const
inline

Definition at line 97 of file torch_matrix.h.

◆ init()

template<class T >
void deeplima::TorchMatrix< T >::init ( int64_t  max_time,
int64_t  max_feat 
)
inline

Definition at line 55 of file torch_matrix.h.

◆ set()

template<class T >
void deeplima::TorchMatrix< T >::set ( int64_t  time,
uint64_t  feat,
T  value 
)
inline

Definition at line 68 of file torch_matrix.h.

◆ size()

template<class T >
uint64_t deeplima::TorchMatrix< T >::size ( ) const
inline

Definition at line 87 of file torch_matrix.h.

◆ to()

template<class T >
void deeplima::TorchMatrix< T >::to ( torch::Device &  device)
inline

Definition at line 102 of file torch_matrix.h.

Member Data Documentation

◆ m_accessor

template<class T >
torch::TensorAccessor<T, 2> deeplima::TorchMatrix< T >::m_accessor
protected

Definition at line 121 of file torch_matrix.h.

◆ m_max_feat

template<class T >
int64_t deeplima::TorchMatrix< T >::m_max_feat
protected

Definition at line 118 of file torch_matrix.h.

◆ m_max_time

template<class T >
int64_t deeplima::TorchMatrix< T >::m_max_time
protected

Definition at line 117 of file torch_matrix.h.

◆ m_start_time

template<class T >
int64_t deeplima::TorchMatrix< T >::m_start_time
protected

Definition at line 116 of file torch_matrix.h.

◆ m_tensor

template<class T >
torch::Tensor deeplima::TorchMatrix< T >::m_tensor
protected

Definition at line 120 of file torch_matrix.h.


The documentation for this class was generated from the following file: