bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
rl_example_11::TorchAdaptor Struct Reference

The TorchStateAdaptor struct. More...

#include <torch_adaptor.h>

Public Types

typedef torch_tensor_t value_type

Public Member Functions

torch_tensor_t operator() (real_t value) const
torch_tensor_t operator() (const std::vector< real_t > &data) const
torch_tensor_t operator() (const std::vector< float_t > &data) const
torch_tensor_t operator() (const std::vector< int > &data) const

Static Public Member Functions

static value_type to_torch (const std::vector< real_t > &data, DeviceType dtype=DeviceType::CPU, bool requires_grad=false)
static value_type to_torch (const std::vector< uint_t > &data, DeviceType dtype=DeviceType::CPU, bool requires_grad=false)
static value_type to_torch (const std::vector< float_t > &data, DeviceType dtype=DeviceType::CPU, bool requires_grad=false)
static value_type to_torch (const std::vector< int_t > &data, DeviceType dtype=DeviceType::CPU, bool requires_grad=false)
static value_type to_torch (const std::vector< lint_t > &data, DeviceType dtype=DeviceType::CPU, bool requires_grad=false)
static value_type to_torch (const std::vector< bool > &data, DeviceType dtype=DeviceType::CPU, bool requires_grad=false)
template<typename T>
static value_type stack (const std::vector< T > &values, DeviceType type=DeviceType::CPU, bool requires_grad=false)
static value_type cat (const std::vector< real_t > &values, DeviceType type=DeviceType::CPU, bool requires_grad=false)
template<typename T>
static value_type stack_as_float (const std::vector< std::vector< T > > &values, DeviceType type=DeviceType::CPU)
template<typename T>
static std::vector< T > to_vector (torch_tensor_t tensor)

Detailed Description

The TorchStateAdaptor struct.

Member Typedef Documentation

◆ value_type

Member Function Documentation

◆ cat()

value_type bitrl::utils::pytorch::TorchAdaptor::cat ( const std::vector< real_t > & values,
DeviceType type = DeviceType::CPU,
bool requires_grad = false )
static

◆ operator()() [1/4]

torch_tensor_t bitrl::utils::pytorch::TorchAdaptor::operator() ( const std::vector< float_t > & data) const

◆ operator()() [2/4]

torch_tensor_t bitrl::utils::pytorch::TorchAdaptor::operator() ( const std::vector< int > & data) const

◆ operator()() [3/4]

torch_tensor_t bitrl::utils::pytorch::TorchAdaptor::operator() ( const std::vector< real_t > & data) const

◆ operator()() [4/4]

torch_tensor_t bitrl::utils::pytorch::TorchAdaptor::operator() ( real_t value) const

◆ stack()

template<typename T>
value_type bitrl::utils::pytorch::TorchAdaptor::stack ( const std::vector< T > & values,
DeviceType type = DeviceType::CPU,
bool requires_grad = false )
static

◆ stack_as_float()

template<typename T>
TorchAdaptor::value_type bitrl::utils::pytorch::TorchAdaptor::stack_as_float ( const std::vector< std::vector< T > > & values,
DeviceType type = DeviceType::CPU )
static

◆ to_torch() [1/6]

value_type bitrl::utils::pytorch::TorchAdaptor::to_torch ( const std::vector< bool > & data,
DeviceType dtype = DeviceType::CPU,
bool requires_grad = false )
static

◆ to_torch() [2/6]

value_type bitrl::utils::pytorch::TorchAdaptor::to_torch ( const std::vector< float_t > & data,
DeviceType dtype = DeviceType::CPU,
bool requires_grad = false )
static

◆ to_torch() [3/6]

value_type bitrl::utils::pytorch::TorchAdaptor::to_torch ( const std::vector< int_t > & data,
DeviceType dtype = DeviceType::CPU,
bool requires_grad = false )
static

◆ to_torch() [4/6]

value_type bitrl::utils::pytorch::TorchAdaptor::to_torch ( const std::vector< lint_t > & data,
DeviceType dtype = DeviceType::CPU,
bool requires_grad = false )
static

◆ to_torch() [5/6]

value_type bitrl::utils::pytorch::TorchAdaptor::to_torch ( const std::vector< real_t > & data,
DeviceType dtype = DeviceType::CPU,
bool requires_grad = false )
static

◆ to_torch() [6/6]

value_type bitrl::utils::pytorch::TorchAdaptor::to_torch ( const std::vector< uint_t > & data,
DeviceType dtype = DeviceType::CPU,
bool requires_grad = false )
static

◆ to_vector()

template<typename T>
std::vector< T > bitrl::utils::pytorch::TorchAdaptor::to_vector ( torch_tensor_t tensor)
static

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