Interface for object which can store parameters.
|
| | ParameterStore (Model *object) |
| |
| | ParameterStore (const ParameterStore &)=delete |
| |
| | ParameterStore (ParameterStore &&)=delete |
| |
| ParameterStore & | operator= (const ParameterStore &)=delete |
| |
| ParameterStore & | operator= (ParameterStore &&)=delete |
| |
| virtual | ~ParameterStore ()=default |
| |
| const std::map< std::string, std::unique_ptr< TensorValueBase > > & | named_parameters () const |
| |
| std::map< std::string, std::unique_ptr< TensorValueBase > > & | named_parameters () |
| |
| const TensorValueBase & | get_parameter (const std::string &name) const |
| | }@
|
| |
| TensorValueBase & | get_parameter (const std::string &name) |
| | Get a writable reference of a parameter.
|
| |
| void | set_parameter (const std::string &, const Tensor &) |
| | Set the value for a parameter.
|
| |
| void | set_parameters (const std::map< std::string, Tensor > &) |
| | Set values for parameters.
|
| |
| virtual void | send_parameters_to (const TensorOptions &options) |
| | Send parameters to options.
|
| |
| template<typename T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
| const T & | declare_parameter (const std::string &name, const T &rawval) |
| | Declare a parameter.
|
| |
| template<typename T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
| const T & | declare_parameter (const std::string &name, const TensorName< T > &tensorname, bool allow_nonlinear) |
| | Declare a parameter.
|
| |
| template<typename T , typename = typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>> |
| const T & | declare_parameter (const std::string &name, const std::string &input_option_name, bool allow_nonlinear=false) |
| | Declare a parameter.
|
| |
| void | assign_parameter_stack (jit::Stack &stack) |
| | Assign stack to parameters.
|
| |
| jit::Stack | collect_parameter_stack () const |
| | Collect stack from parameters.
|
| |
template<typename T , typename >
| const T & declare_parameter |
( |
const std::string & | name, |
|
|
const T & | rawval ) |
|
protected |
Declare a parameter.
Note that all parameters are stored in the host (the object exposed to users). An object may be used multiple times in the host, and the same parameter may be declared multiple times. That is allowed, but only the first call to declare_parameter constructs the parameter value, and subsequent calls only returns a reference to the existing parameter.
- Template Parameters
-
- Parameters
-
| name | Buffer name |
| rawval | Buffer value |
- Returns
- Reference to buffer