29#include <torch/csrc/jit/frontend/tracer.h>
31#include "neml2/misc/types.h"
44using namespace torch::jit;
61 const std::map<std::string, std::unique_ptr<TensorValueBase>> &
named_buffers()
const
66 std::map<std::string, std::unique_ptr<TensorValueBase>> &
named_buffers();
99 template <
typename T,
typename =
typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>>
113 template <
typename T,
typename =
typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>>
128 template <
typename T,
typename =
typename std::enable_if_t<std::is_base_of_v<TensorBase<T>, T>>>
141 std::map<std::string, std::unique_ptr<TensorValueBase>> _buffer_values;
144 std::map<std::string, Size> _buffer_intmd_dims;
virtual ~BufferStore()=default
BufferStore(const BufferStore &)=delete
void assign_buffer_stack(jit::Stack &stack)
Assign stack to buffers.
const T & declare_buffer(const std::string &name, const T &rawval)
Declare a buffer.
const std::map< std::string, std::unique_ptr< TensorValueBase > > & named_buffers() const
Definition BufferStore.h:61
const TensorValueBase & get_buffer(const std::string &name) const
}@
Definition BufferStore.h:70
TensorValueBase & get_buffer(const std::string &name)
Get a writable reference of a buffer.
std::map< std::string, std::unique_ptr< TensorValueBase > > & named_buffers()
jit::Stack collect_buffer_stack() const
Collect stack from buffers.
virtual void send_buffers_to(const TensorOptions &options)
Send all buffers to options.
BufferStore & operator=(const BufferStore &)=delete
BufferStore & operator=(BufferStore &&)=delete
const T & declare_buffer(const std::string &name, const TensorName< T > &tensorname)
Declare a buffer.
BufferStore(BufferStore &&)=delete
BufferStore(NEML2Object *object)
const T & declare_buffer(const std::string &name, const std::string &input_option_name)
Declare a buffer.
The base class of all "manufacturable" objects in the NEML2 library.
Definition NEML2Object.h:52
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
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