26#include "neml2/tensors/BatchTensor.h"
27#include "neml2/misc/parser_utils.h"
42 virtual void to(
const torch::TensorOptions &) = 0;
63 virtual void to(
const torch::TensorOptions & options)
override { _value = _value.to(options); }
65 virtual operator BatchTensor()
const override {
return _value; }
67 template <
typename T2 = T,
typename =
typename std::enable_if_t<!std::is_same_v<T2, BatchTensor>>>
Definition BatchTensor.h:32
The wrapper (decorator) for cross-referencing unresolved values at parse time.
Definition CrossRef.h:52
The base class to allow us to set up a polymorphic container of BatchTensors. The concrete definition...
Definition TensorValue.h:37
virtual void set(const BatchTensor &val)=0
Set the parameter value.
virtual void to(const torch::TensorOptions &)=0
Send the value to the target options.
virtual ~TensorValueBase()=default
Concrete definition of tensor value.
Definition TensorValue.h:54
virtual void set(const BatchTensor &val) override
Set the parameter value.
Definition TensorValue.h:75
TensorValue(const T &value)
Definition TensorValue.h:58
T & value()
Definition TensorValue.h:73
virtual void to(const torch::TensorOptions &options) override
Send the value to the target options.
Definition TensorValue.h:63
Definition CrossRef.cxx:32