29#include <torch/csrc/jit/frontend/tracer.h>
31#include "neml2/misc/types.h"
47using namespace torch::jit;
64 const std::map<std::string, std::unique_ptr<TensorValueBase>> &
named_parameters()
const
107 template <
typename T,
typename =
typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>>
122 template <
typename T,
typename =
typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>>
125 bool allow_nonlinear);
140 template <
typename T,
typename =
typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>>
142 const std::string & input_option_name,
143 bool allow_nonlinear =
false);
155 std::map<std::string, std::unique_ptr<TensorValueBase>> _param_values;
158 std::map<std::string, Size> _param_intmd_dims;
The base class of all "manufacturable" objects in the NEML2 library.
Definition NEML2Object.h:52
ParameterStore & operator=(const ParameterStore &)=delete
void set_parameter(const std::string &, const Tensor &)
Set the value for a parameter.
jit::Stack collect_parameter_stack() const
Collect stack from parameters.
void set_parameters(const std::map< std::string, Tensor > &)
Set values for parameters.
void assign_parameter_stack(jit::Stack &stack)
Assign stack to parameters.
const T & declare_parameter(const std::string &name, const TensorName< T > &tensorname, bool allow_nonlinear)
Declare a parameter.
const T & declare_parameter(const std::string &name, const std::string &input_option_name, bool allow_nonlinear=false)
Declare a parameter.
ParameterStore & operator=(ParameterStore &&)=delete
const std::map< std::string, std::unique_ptr< TensorValueBase > > & named_parameters() const
Definition ParameterStore.h:64
const TensorValueBase & get_parameter(const std::string &name) const
}@
Definition ParameterStore.h:73
ParameterStore(const ParameterStore &)=delete
virtual ~ParameterStore()=default
TensorValueBase & get_parameter(const std::string &name)
Get a writable reference of a parameter.
std::map< std::string, std::unique_ptr< TensorValueBase > > & named_parameters()
const T & declare_parameter(const std::string &name, const T &rawval)
Declare a parameter.
virtual void send_parameters_to(const TensorOptions &options)
Send parameters to options.
ParameterStore(ParameterStore &&)=delete
ParameterStore(NEML2Object *object)
NEML2's enhanced tensor type.
Definition TensorBase.h:77
The base class to allow us to set up a polymorphic container of Tensors. The concrete definitions wil...
Definition TensorValue.h:41
Base class of variable.
Definition VariableBase.h:53
Definition BufferStore.h:43
Definition DiagnosticsInterface.h:31
std::string name(ElasticConstant p)
c10::TensorOptions TensorOptions
Definition types.h:66
The name of a tensor object that can be referenced in the input files.
Definition TensorName.h:47