|
NEML2 2.1.0
|
#include <AxisLayout.h>
Public Types | |
| enum class | IStructure : uint8_t { DENSE , BLOCK } |
| Enum for the structure represented by intermediate dimensions (if any). More... | |
Public Member Functions | |
| AxisLayout ()=default | |
| AxisLayout (const std::vector< std::vector< VariableName > > &vars, std::vector< TensorShape > intmd_shapes, std::vector< TensorShape > base_shapes, std::vector< IStructure > istrs) | |
| Construct a new Axis Layout object. | |
| AxisLayout (const AxisLayout *parent, std::size_t group_idx, std::size_t start, std::size_t end, std::vector< std::size_t > offsets={}) | |
| Construct a new Axis Layout object by viewing into a parent layout. | |
| std::size_t | ngroup () const |
| Number of variable groups. | |
| std::pair< std::size_t, std::size_t > | group_offsets (std::size_t) const |
| Starting and ending offsets of a variable group. | |
| AxisLayout | group (std::size_t) const |
| Contiguous view of the variable group. | |
| IStructure | istr (std::size_t=0) const |
| Variable group IStructure. | |
| AxisLayout | view () const |
| Contiguous view of the entire layout. | |
| bool | is_view () const |
| Whether this is a view into a parent layout. | |
| std::size_t | nvar () const |
| Number of variables. | |
| std::vector< Size > | storage_sizes (bool include_intmd) const |
| Storage sizes of variables. | |
| std::vector< VariableName > | vars () const |
| Accessor for variable names. | |
| const VariableName & | var (std::size_t) const |
| Accessor for variable name. | |
| const TensorShape & | intmd_sizes (std::size_t) const |
| Accessor for variable intermediate shape. | |
| const TensorShape & | base_sizes (std::size_t) const |
| Accessor for variable base shape. | |
| void | update_intmd_shapes (const std::vector< TensorShape > &) |
| Update intermediate shapes. | |
|
strong |
|
default |
| AxisLayout | ( | const std::vector< std::vector< VariableName > > & | vars, |
| std::vector< TensorShape > | intmd_shapes, | ||
| std::vector< TensorShape > | base_shapes, | ||
| std::vector< IStructure > | istrs ) |
Construct a new Axis Layout object.
| vars | ID-to-variable mapping, partitioned by variable groups |
| intmd_shapes | ID-to-variable intermediate shape mapping |
| base_shapes | ID-to-variable base shape mapping |
| istrs | IStructure for each variable group |
| AxisLayout | ( | const AxisLayout * | parent, |
| std::size_t | group_idx, | ||
| std::size_t | start, | ||
| std::size_t | end, | ||
| std::vector< std::size_t > | offsets = {} ) |
Construct a new Axis Layout object by viewing into a parent layout.
| parent | The axis layout this is viewing into |
| group_idx | The group index of the view |
| start | The starting offset of the view (inclusive) |
| end | The ending offset of the view (exclusive) |
| offsets | The offsets of the variable groups in the view |
| const TensorShape & base_sizes | ( | std::size_t | ) | const |
Accessor for variable base shape.
| AxisLayout group | ( | std::size_t | ) | const |
Contiguous view of the variable group.
| std::pair< std::size_t, std::size_t > group_offsets | ( | std::size_t | ) | const |
Starting and ending offsets of a variable group.
| const TensorShape & intmd_sizes | ( | std::size_t | ) | const |
Accessor for variable intermediate shape.
|
inline |
Whether this is a view into a parent layout.
| IStructure istr | ( | std::size_t | = 0 | ) | const |
Variable group IStructure.
| std::size_t ngroup | ( | ) | const |
Number of variable groups.
| std::size_t nvar | ( | ) | const |
Number of variables.
| std::vector< Size > storage_sizes | ( | bool | include_intmd | ) | const |
Storage sizes of variables.
| void update_intmd_shapes | ( | const std::vector< TensorShape > & | ) |
Update intermediate shapes.
| const VariableName & var | ( | std::size_t | ) | const |
Accessor for variable name.
| std::vector< VariableName > vars | ( | ) | const |
Accessor for variable names.
| AxisLayout view | ( | ) | const |
Contiguous view of the entire layout.