NEML2 1.4.0
|
#include <Variable.h>
Protected Attributes | |
const VariableName | _name |
Name of the variable. | |
TorchShape | _batch_sizes |
Batch shape of this variable. | |
std::vector< VariableName > | _args |
Names of the variables that this variable depends on. | |
BatchTensor | _raw_value |
The raw (flattened) variable value. | |
std::map< VariableName, BatchTensor > | _dvalue_d |
The derivative of this variable w.r.t. arguments. | |
std::map< VariableName, std::map< VariableName, BatchTensor > > | _d2value_d |
The second derivative of this variable w.r.t. arguments. | |
const LabeledVector * | _value_storage |
The value storage that this variable is viewing into. | |
const LabeledMatrix * | _derivative_storage |
The derivative storage that this variable is viewing into. | |
const LabeledTensor3D * | _second_derivative_storage |
The second derivative storage that this variable is viewing into. | |
|
inline |
|
virtualdefault |
|
inline |
Add an argument.
|
inline |
Arguments.
|
inline |
Base dimension.
|
pure virtual |
|
inline |
Base storage.
|
inline |
Batch dimension.
|
inline |
Batch shape.
|
virtual |
Cache the variable's batch shape.
Reimplemented in Variable< T >, Variable< neml2::BatchTensor >, Variable< neml2::R2 >, Variable< neml2::Rot >, Variable< neml2::Scalar >, Variable< neml2::SR2 >, Variable< neml2::Vec >, Variable< neml2::WR2 >, and Variable< Scalar >.
|
inline |
Clear arguments.
Derivative d | ( | const VariableBase & | x | ) |
Create a wrapper representing the derivative dy/dx.
Derivative d | ( | const VariableBase & | x1, |
const VariableBase & | x2 ) |
Create a wrapper representing the second derivative d2y/dx2.
const LabeledMatrix & derivative_storage | ( | ) | const |
|
inline |
Name of this variable.
|
inline |
Raw flattened variable value.
Reinitialize variable views.
Reimplemented in Variable< T >, Variable< neml2::BatchTensor >, Variable< neml2::R2 >, Variable< neml2::Rot >, Variable< neml2::Scalar >, Variable< neml2::SR2 >, Variable< neml2::Vec >, Variable< neml2::WR2 >, and Variable< Scalar >.
Set requires_grad for the underlying storage.
Implemented in Variable< T >, Variable< neml2::BatchTensor >, Variable< neml2::R2 >, Variable< neml2::Rot >, Variable< neml2::Scalar >, Variable< neml2::SR2 >, Variable< neml2::Vec >, Variable< neml2::WR2 >, and Variable< Scalar >.
const LabeledTensor3D & second_derivative_storage | ( | ) | const |
void setup_views | ( | const LabeledVector * | value, |
const LabeledMatrix * | deriv = nullptr, | ||
const LabeledTensor3D * | secderiv = nullptr ) |
Setup the variable's views into blocks of the storage.
void setup_views | ( | const VariableBase * | other | ) |
Setup the variable's views into blocks of the storage.
|
pure virtual |
Total shape.
Implemented in Variable< T >, Variable< neml2::BatchTensor >, Variable< neml2::R2 >, Variable< neml2::Rot >, Variable< neml2::Scalar >, Variable< neml2::SR2 >, Variable< neml2::Vec >, Variable< neml2::WR2 >, and Variable< Scalar >.
|
pure virtual |
Variable value of the logical shape.
Implemented in Variable< T >, Variable< neml2::BatchTensor >, Variable< neml2::R2 >, Variable< neml2::Rot >, Variable< neml2::Scalar >, Variable< neml2::SR2 >, Variable< neml2::Vec >, Variable< neml2::WR2 >, and Variable< Scalar >.
const LabeledVector & value_storage | ( | ) | const |
Accessors for storage.
|
protected |
Names of the variables that this variable depends on.
|
protected |
Batch shape of this variable.
|
protected |
The second derivative of this variable w.r.t. arguments.
|
protected |
The derivative storage that this variable is viewing into.
|
protected |
The derivative of this variable w.r.t. arguments.
|
protected |
Name of the variable.
|
protected |
The raw (flattened) variable value.
|
protected |
The second derivative storage that this variable is viewing into.
|
protected |
The value storage that this variable is viewing into.