25#include "neml2/models/BufferStore.h"
39 "named_buffers() should only be called on the host model.");
40 return _buffer_values;
46 neml_assert(_object->
host() == _object,
"This method should only be called on the host model.");
48 for (
auto && [name,
buffer] : _buffer_values)
virtual void send_buffers_to(const torch::TensorOptions &options)
Send all buffers to options.
Definition BufferStore.cxx:44
const Storage< std::string, TensorValueBase > & named_buffers() const
Definition BufferStore.h:42
BufferStore(const OptionSet &options, NEML2Object *object)
Definition BufferStore.cxx:29
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
The base class of all "manufacturable" objects in the NEML2 library.
Definition NEML2Object.h:38
const T * host() const
Get a readonly pointer to the host.
Definition NEML2Object.h:90
A custom map-like data structure. The keys are strings, and the values can be nonhomogeneously typed.
Definition OptionSet.h:59
Definition CrossRef.cxx:32
void neml_assert(bool assertion, Args &&... args)
Definition error.h:73