bitsim
Model, simulate, estimate and control robots in C++
Loading...
Searching...
No Matches
bitrl_concepts.h
Go to the documentation of this file.
1#ifndef CUBEAI_CONCEPTS_H
2#define CUBEAI_CONCEPTS_H
10
11#include "bitrl/base/bitrl_config.h"
12
13#ifdef USE_PYTORCH
14#include "torch/torch.h"
15#endif
16
17#include <type_traits>
18
19namespace bitrl
20{
21namespace utils
22{
23namespace concepts
24{
25
26template <typename VectorType>
27concept integral_vector = std::is_integral<typename VectorType::value_type>::value;
28
29template <typename VectorType>
30concept float_vector = std::is_floating_point<typename VectorType::value_type>::value;
31
32template <typename VectorType>
33concept float_or_integral_vector = std::is_integral<typename VectorType::value_type>::value ||
34 std::is_floating_point<typename VectorType::value_type>::value;
35
36template <typename Type>
37concept is_default_constructible = std::is_default_constructible<Type>::value;
38
39#ifdef USE_PYTORCH
40template <typename AlgoType>
41concept pytorch_module = std::is_base_of<torch::nn::Module, AlgoType>::value;
42#endif
43
44} // namespace concepts
45
46} // namespace utils
47} // namespace bitrl
48
49#endif // CUBEAI_CONSTRAINTS_H
Definition bitrl_concepts.h:30
Definition bitrl_concepts.h:27
Definition bitrl_concepts.h:41
Definition bitrl_concepts.h:24
Definition bitrl_concepts.h:22
Various utilities used when working with RL problems.
Definition bitrl_log.h:25