26#include "neml2/tensors/Tensor.h"
27#include "neml2/models/utils.h"
60 virtual
void operator=(const
Tensor & val) = 0;
79 : _value(std::move(value))
86 operator Tensor()
const override;
The base class to allow us to set up a polymorphic container of Tensors. The concrete definitions wil...
Definition TensorValue.h:40
TensorValueBase(const TensorValueBase &)=default
TensorValueBase()=default
TensorValueBase(TensorValueBase &&) noexcept=default
Size _cached_intmd_dim
Cached intermediate dimension.
Definition TensorValue.h:70
TensorValueBase & operator=(const TensorValueBase &)=default
virtual void assign(const ATensor &val, TracerPrivilege key)=0
Secret assignment operator used by low-level operations such as jit tracing.
virtual TensorType type() const =0
Tensor type.
virtual void to_(const TensorOptions &)=0
Send the value to the target options.
virtual void requires_grad_(bool req=true)=0
Require grad.
Concrete definition of tensor value.
Definition TensorValue.h:76
const T & operator()() const
Definition TensorValue.h:89
TensorValue(T value)
Definition TensorValue.h:78
Definition DiagnosticsInterface.cxx:30
at::Tensor ATensor
Definition types.h:38
int64_t Size
Definition types.h:65
TensorType
Definition tensors.h:56
c10::TensorOptions TensorOptions
Definition types.h:60
A passkey to allow trusted classes to perform raw assignment to variables and parameters.
Definition utils.h:35