#include <VariableStore.h>
|
| virtual void | send_variables_to (const TensorOptions &options) |
| | Send padding variables to options.
|
| |
| template<typename T > |
| const Variable< T > & | declare_input_variable (const char *name, TensorShapeRef dep_intmd_dims={}, bool allow_duplicate=false) |
| | Declare an input variable.
|
| |
| template<typename T > |
| const Variable< T > & | declare_input_variable (const VariableName &name, TensorShapeRef dep_intmd_dims={}, bool allow_duplicate=false) |
| | Declare an input variable.
|
| |
| template<typename T > |
| Variable< T > & | declare_output_variable (const char *name, TensorShapeRef dep_intmd_dims={}) |
| | Declare an output variable.
|
| |
| template<typename T > |
| Variable< T > & | declare_output_variable (const VariableName &name, TensorShapeRef dep_intmd_dims={}) |
| | Declare an output variable.
|
| |
| const VariableBase * | clone_input_variable (const VariableBase &var, const VariableName &new_name={}) |
| | Clone a variable and put it on the input axis.
|
| |
| VariableBase * | clone_output_variable (const VariableBase &var, const VariableName &new_name={}) |
| | Clone a variable and put it on the output axis.
|
| |
| void | assign_input_stack (jit::Stack &stack) |
| | Assign stack to input variables.
|
| |
| void | assign_output_stack (jit::Stack &stack, bool out, bool dout, bool d2out) |
| | Assign stack to output variables and derivatives.
|
| |
| jit::Stack | collect_input_stack () const |
| | Collect stack from input variables.
|
| |
| jit::Stack | collect_output_stack (bool out, bool dout, bool d2out) const |
| | Collect stack from output variables and derivatives.
|
| |
◆ DerivSparsity
◆ SecDerivSparsity
Initial value:
std::vector<std::tuple<VariableBase *, const VariableBase *, const VariableBase *>>
◆ VariableStorage
◆ VariableStore() [1/3]
◆ VariableStore() [2/3]
◆ VariableStore() [3/3]
◆ ~VariableStore()
◆ assign_input()
| void assign_input |
( |
const ValueMap & | vals, |
|
|
bool | assembly = false ) |
Assign input variable values assembly indicates if vals are in assembly format
◆ assign_input_stack()
| void assign_input_stack |
( |
jit::Stack & | stack | ) |
|
|
protected |
Assign stack to input variables.
◆ assign_output()
| void assign_output |
( |
const ValueMap & | vals, |
|
|
bool | assembly = false ) |
Assign output variable values assembly indicates if vals are in assembly format
◆ assign_output_derivatives()
| void assign_output_derivatives |
( |
const DerivMap & | derivs, |
|
|
bool | assembly = false ) |
Assign variable derivatives assembly indicates if derivs are in assembly format
◆ assign_output_stack()
| void assign_output_stack |
( |
jit::Stack & | stack, |
|
|
bool | out, |
|
|
bool | dout, |
|
|
bool | d2out ) |
|
protected |
Assign stack to output variables and derivatives.
◆ cache_derivative_sparsity()
| void cache_derivative_sparsity |
( |
| ) |
|
Cache sparsity of first derivatives
◆ cache_second_derivative_sparsity()
| void cache_second_derivative_sparsity |
( |
| ) |
|
Cache sparsity of second derivatives.
◆ clear_derivatives()
| void clear_derivatives |
( |
| ) |
|
|
virtual |
◆ clear_input()
Release allocated tensor
Reimplemented in Model.
◆ clear_output()
◆ clone_input_variable()
Clone a variable and put it on the input axis.
◆ clone_output_variable()
Clone a variable and put it on the output axis.
◆ collect_input()
| ValueMap collect_input |
( |
bool | assembly = false | ) |
const |
Collect input variable values assembly indicates if the returned map should be in assembly format
◆ collect_input_stack()
| jit::Stack collect_input_stack |
( |
| ) |
const |
|
protected |
Collect stack from input variables.
◆ collect_output()
| ValueMap collect_output |
( |
bool | assembly = false | ) |
const |
Collect output variable values assembly indicates if the returned map should be in assembly format
◆ collect_output_derivatives()
| DerivMap collect_output_derivatives |
( |
bool | assembly = false | ) |
const |
Collect variable derivatives assembly indicates if the returned map should be in assembly format
◆ collect_output_second_derivatives()
| SecDerivMap collect_output_second_derivatives |
( |
bool | assembly = false | ) |
const |
Collect variable second derivatives assembly indicates if the returned map should be in assembly format
◆ collect_output_stack()
| jit::Stack collect_output_stack |
( |
bool | out, |
|
|
bool | dout, |
|
|
bool | d2out ) const |
|
protected |
Collect stack from output variables and derivatives.
◆ declare_axis()
◆ declare_input_variable() [1/2]
template<typename T >
| const Variable< T > & declare_input_variable |
( |
const char * | name, |
|
|
TensorShapeRef | dep_intmd_dims = {}, |
|
|
bool | allow_duplicate = false ) |
|
protected |
Declare an input variable.
◆ declare_input_variable() [2/2]
Declare an input variable.
◆ declare_output_variable() [1/2]
Declare an output variable.
◆ declare_output_variable() [2/2]
Declare an output variable.
◆ derivative_sparsity()
◆ input_axis() [1/2]
Input axis describing the assembly layout of input variables
◆ input_axis() [2/2]
◆ input_variable() [1/2]
Lookup a variable by name
◆ input_variable() [2/2]
◆ input_variables() [1/2]
◆ input_variables() [2/2]
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ output_axis() [1/2]
Output axis describing the assembly layout of output variables
◆ output_axis() [2/2]
◆ output_variable() [1/2]
◆ output_variable() [2/2]
◆ output_variables() [1/2]
◆ output_variables() [2/2]
◆ second_derivative_sparsity()
Second derivative sparsity.
◆ send_variables_to()
Send padding variables to options.
- Parameters
-
| options | The target options |
◆ set_input_intmd_sizes()
Tag intermediate shapes for variables.
This is needed for two purposes:
- By default we initialize undefined input variables to zero before evaluating the model. If a variable is tagged with an non-empty intermediate shape, the zero tensor will be created with that shape.
- When using input/output axis for assembly, we need to know the intermediate sizes of each variable to correctly convert between variable format and assembly format. Variables are added to the LabeledAxis assuming zero intermediate dimension. If the actual intermediate shape is different, we need to use this method to inform the LabeledAxis about the correct shapes.
- Note
- This manual tagging is only necessary for the external-facing host models. We have the appropriate caching mechanism for sub-models (e.g., inside a ComposedModel) when they are being evaluated. In other words, this manual tagging is only necessary if variable intermediate shapes are needed before any model evaluation.
- Warning
- We spend no effort on verifying the correctness of the tagged shapes. It is the user's responsibility to ensure the correctness of the tagged shapes.
◆ set_output_intmd_sizes()
◆ variable_options()
Current tensor options for variables.
◆ zero_undefined_input()
| void zero_undefined_input |
( |
| ) |
|
|
virtual |
Fill undefined input variables with zeros.
Reimplemented in Model.
◆ resolve_tensor_name
template<typename T >
| const T & resolve_tensor_name |
( |
const TensorName< T > & | tn, |
|
|
Model * | caller, |
|
|
const std::string & | pname ) |
|
friend |