bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
torch_tensor_utils.h File Reference
#include "bitrl/base/bitrl_config.h"
#include "bitrl/base/bitrl_types.h"
#include <torch/torch.h>
#include <cstdint>
#include <stdexcept>
#include <string>
#include <vector>
Include dependency graph for torch_tensor_utils.h:

Go to the source code of this file.

Namespaces

namespace  bitrl
 Various utilities used when working with RL problems.
namespace  bitrl::torch_utils

Functions

template<typename ContainerType>
torch_tensor_t bitrl::torch_utils::create_mask (const ContainerType &container)
 create_mask. Create a boolean mask from the given container. The container should hold values convertible to bool
template<typename TorchNetType>
void bitrl::torch_utils::copy_parameters (const TorchNetType &from, TorchNetType &to)
 copy_parameters. Copy the parameters and buffers of one network into another of the same type, for example into the target network of DQN
template<typename TorchNetType>
void bitrl::torch_utils::copy_parameters_to (TorchNetType &to, const std::string &params_path)
 copy_parameters_to. Copy into to the parameters and buffers of a network of the same type that was saved with torch::save to params_path. TorchNetType must be default constructible