NEML2 2.0.0
Loading...
Searching...
No Matches
FillWR2 Class Reference

Create a filled WR2 from the input file. More...

Detailed Description

Create a filled WR2 from the input file.

#include <FillWR2.h>

Inheritance diagram for FillWR2:

Public Member Functions

 FillWR2 (const OptionSet &options)
 
- Public Member Functions inherited from UserTensorBase< WR2 >
 UserTensorBase (const OptionSet &options)
 
void setup () override
 Setup this object.
 
- Public Member Functions inherited from NEML2Object
 NEML2Object ()=delete
 
 NEML2Object (NEML2Object &&)=delete
 
 NEML2Object (const NEML2Object &)=delete
 
NEML2Objectoperator= (NEML2Object &&)=delete
 
NEML2Objectoperator= (const NEML2Object &)=delete
 
virtual ~NEML2Object ()=default
 
 NEML2Object (const OptionSet &options)
 Construct a new NEML2Object object.
 
const OptionSetinput_options () const
 
const std::string & name () const
 A readonly reference to the object's name.
 
const std::string & type () const
 A readonly reference to the object's type.
 
const std::string & path () const
 A readonly reference to the object's path.
 
const std::string & doc () const
 A readonly reference to the object's docstring.
 
Factoryfactory () const
 Get the factory that created this object.
 
const Settingssettings () const
 Settings.
 
template<typename T = NEML2Object>
const T * host () const
 Get a readonly pointer to the host.
 
template<typename T = NEML2Object>
T * host ()
 Get a writable pointer to the host.
 
template<typename T >
const T & resolve_tensor (const std::string &name)
 Resolve a TensorName to a Tensor.
 
template<class T >
std::shared_ptr< T > get_object (const std::string &section, const std::string &name)
 
template<class T = Solver>
std::shared_ptr< T > get_solver (const std::string &name)
 Get a solver from the factory.
 
template<class T = Data>
std::shared_ptr< T > get_data (const std::string &name)
 Get a data from the factory.
 
template<class T = Model>
std::shared_ptr< T > get_model (const std::string &name)
 Get a model from the factory.
 
template<class T = Driver>
std::shared_ptr< T > get_driver (const std::string &name)
 Get a driver from the factory.
 
template<class T = WorkScheduler>
std::shared_ptr< T > get_scheduler (const std::string &name)
 Get a scheduler from the factory.
 
- Public Member Functions inherited from WR2
 WR2 (const R2 &T)
 Skew-symmetrize a R2 then fill.
 
Scalar operator() (Size i, Size j) const
 Accessor.
 
Rot exp_map () const
 Exponential map to make this into a rotation (Rot)
 
R2 dexp_map () const
 Derivative of the exponential map.
 
- Public Member Functions inherited from VecBase< WR2 >
WR2 rotate (const Rot &r) const
 Rotate using a Rodrigues vector.
 
WR2 rotate (const R2 &R) const
 Rotate using a rotation matrix.
 
R2 drotate (const Rot &r) const
 Derivative of the rotated vector w.r.t. the Rodrigues vector.
 
R3 drotate (const R2 &R) const
 Derivative of the rotated vector w.r.t. the rotation matrix.
 
- Public Member Functions inherited from PrimitiveTensor< WR2, 3 >
 PrimitiveTensor ()=default
 Special member functions.
 
 PrimitiveTensor (const ATensor &tensor, Size intmd_dim)
 Construct from an ATensor and infer dynamic shape.
 
 PrimitiveTensor (const ATensor &tensor, Size dynamic_dim, Size intmd_dim)
 Construct from an ATensor and extract dynamic shape given dynamic dimension.
 
 PrimitiveTensor (const ATensor &tensor, const TraceableTensorShape &dynamic_shape, Size intmd_dim)
 Construct from an ATensor given dynamic shape.
 
 PrimitiveTensor (const TensorBase< Derived2 > &tensor)
 Copy constructor.
 
 operator neml2::Tensor () const
 Implicit conversion to a Tensor (discards information on the fixed base shape)
 
Scalar operator() (Args... i) const
 Single-element accessor.
 
- Public Member Functions inherited from TensorBase< WR2 >
 TensorBase ()=default
 Default constructor.
 
 TensorBase (const ATensor &tensor, Size dynamic_dim, Size intmd_dim)
 Construct from an ATensor with given dynamic dimension.
 
 TensorBase (const ATensor &tensor, TraceableTensorShape dynamic_shape, Size intmd_dim)
 Construct from an ATensor with given dynamic shape.
 
 TensorBase (const TensorBase< Derived2 > &tensor)
 Copy constructor.
 
 TensorBase (double)=delete
 
 TensorBase (float)=delete
 
 TensorBase (int)=delete
 
WR2 variable_data () const
 Variable data without function graph.
 
WR2 contiguous () const
 
WR2 clone () const
 Clone (take ownership)
 
WR2 detach () const
 Discard function graph.
 
WR2 to (const TensorOptions &options) const
 Change tensor options.
 
WR2 operator- () const
 Negation.
 
Size batch_dim () const
 
Size base_dim () const
 
Size dynamic_dim () const
 
Size static_dim () const
 
Size intmd_dim () const
 
TraceableTensorShape batch_sizes () const
 
TensorShapeRef base_sizes () const
 
const TraceableTensorShapedynamic_sizes () const
 
TensorShapeRef static_sizes () const
 
TensorShapeRef intmd_sizes () const
 
TraceableSize batch_size (Size i) const
 
Size base_size (Size i) const
 
const TraceableSizedynamic_size (Size i) const
 
Size static_size (Size i) const
 
Size intmd_size (Size i) const
 
WR2 dynamic_index (indexing::TensorIndicesRef indices) const
 
WR2 intmd_index (indexing::TensorIndicesRef indices) const
 
neml2::Tensor base_index (indexing::TensorIndicesRef indices) const
 
WR2 dynamic_slice (Size d, const indexing::Slice &index) const
 
WR2 intmd_slice (Size d, const indexing::Slice &index) const
 
neml2::Tensor base_slice (Size d, const indexing::Slice &index) const
 
void dynamic_index_put_ (indexing::TensorIndicesRef indices, const ATensor &other)
 
void dynamic_index_put_ (indexing::TensorIndicesRef indices, const CScalar &v)
 
void intmd_index_put_ (indexing::TensorIndicesRef indices, const ATensor &other)
 
void intmd_index_put_ (indexing::TensorIndicesRef indices, const CScalar &v)
 
void base_index_put_ (indexing::TensorIndicesRef indices, const ATensor &other)
 
void base_index_put_ (indexing::TensorIndicesRef indices, const CScalar &v)
 
WR2 dynamic_expand (const TraceableTensorShape &shape) const
 
WR2 intmd_expand (TensorShapeRef shape) const
 
neml2::Tensor base_expand (TensorShapeRef shape) const
 
WR2 batch_expand (const TraceableTensorShape &dynamic_shape, TensorShapeRef intmd_shape) const
 
neml2::Tensor static_expand (TensorShapeRef intmd_shape, TensorShapeRef base_shape) const
 
WR2 dynamic_expand (const TraceableSize &size, Size d) const
 
WR2 intmd_expand (Size size, Size d) const
 
neml2::Tensor base_expand (Size size, Size d) const
 
WR2 dynamic_expand_as (const neml2::Tensor &other) const
 
WR2 intmd_expand_as (const neml2::Tensor &other) const
 
neml2::Tensor base_expand_as (const neml2::Tensor &other) const
 
WR2 batch_expand_as (const neml2::Tensor &other) const
 
neml2::Tensor static_expand_as (const neml2::Tensor &other) const
 
WR2 dynamic_reshape (const TraceableTensorShape &shape) const
 
WR2 intmd_reshape (TensorShapeRef shape) const
 
neml2::Tensor base_reshape (TensorShapeRef shape) const
 
WR2 batch_reshape (const TraceableTensorShape &dynamic_shape, TensorShapeRef intmd_shape) const
 
neml2::Tensor static_reshape (TensorShapeRef intmd_shape, TensorShapeRef base_shape) const
 
WR2 dynamic_squeeze (Size d) const
 
WR2 intmd_squeeze (Size d) const
 
neml2::Tensor base_squeeze (Size d) const
 
WR2 dynamic_unsqueeze (Size d, Size n=1) const
 
WR2 intmd_unsqueeze (Size d, Size n=1) const
 
neml2::Tensor base_unsqueeze (Size d, Size n=1) const
 
WR2 dynamic_transpose (Size d1, Size d2) const
 
WR2 intmd_transpose (Size d1, Size d2) const
 
neml2::Tensor base_transpose (Size d1, Size d2) const
 
WR2 dynamic_movedim (Size old_dim, Size new_dim) const
 
WR2 intmd_movedim (Size old_dim, Size new_dim) const
 
neml2::Tensor base_movedim (Size old_dim, Size new_dim) const
 
WR2 dynamic_flatten () const
 
WR2 intmd_flatten () const
 
neml2::Tensor base_flatten () const
 
WR2 batch_flatten () const
 Flatten batch dimensions.
 
neml2::Tensor static_flatten () const
 Flatten static dimensions.
 

Static Public Member Functions

static OptionSet expected_options ()
 
- Static Public Member Functions inherited from UserTensorBase< WR2 >
static OptionSet expected_options ()
 
- Static Public Member Functions inherited from NEML2Object
static OptionSet expected_options ()
 
- Static Public Member Functions inherited from PrimitiveTensor< WR2, 3 >
static WR2 create (const TensorDataContainer &data, Size intmd_dim=0, const TensorOptions &options=default_tensor_options())
 Arbitrary tensor from a nested container with inferred batch dimension.
 
static WR2 einsum (c10::string_view equation, TensorList tensors)
 Einstein summation along base dimensions.
 
static WR2 empty (const TensorOptions &options=default_tensor_options())
 
static WR2 empty (const TraceableTensorShape &dynamic_shape, TensorShapeRef intmd_shape={}, const TensorOptions &options=default_tensor_options())
 
static WR2 zeros (const TensorOptions &options=default_tensor_options())
 
static WR2 zeros (const TraceableTensorShape &dynamic_shape, TensorShapeRef intmd_shape={}, const TensorOptions &options=default_tensor_options())
 
static WR2 ones (const TensorOptions &options=default_tensor_options())
 
static WR2 ones (const TraceableTensorShape &dynamic_shape, TensorShapeRef intmd_shape={}, const TensorOptions &options=default_tensor_options())
 
static WR2 full (const CScalar &init, const TensorOptions &options=default_tensor_options())
 
static WR2 full (const TraceableTensorShape &dynamic_shape, TensorShapeRef intmd_shape, const CScalar &init, const TensorOptions &options=default_tensor_options())
 
static WR2 rand (const TensorOptions &options=default_tensor_options())
 
static WR2 rand (const TraceableTensorShape &dynamic_shape, TensorShapeRef intmd_shape, const TensorOptions &options=default_tensor_options())
 
static WR2 fill (Args &&... args)
 
- Static Public Member Functions inherited from TensorBase< WR2 >
static WR2 empty_like (const WR2 &other)
 
static WR2 zeros_like (const WR2 &other)
 Zero tensor like another, i.e. same batch and base shapes, same tensor options, etc.
 
static WR2 ones_like (const WR2 &other)
 Unit tensor like another, i.e. same batch and base shapes, same tensor options, etc.
 
static WR2 full_like (const WR2 &other, const CScalar &init)
 
static WR2 rand_like (const WR2 &other)
 

Protected Member Functions

WR2 make () const override
 Create the tensor given input options.
 
- Protected Member Functions inherited from UserTensorBase< WR2 >
- Protected Member Functions inherited from PrimitiveTensor< WR2, 3 >
void validate_shapes_and_dims () const
 Validate shapes and dimensions.
 
- Protected Member Functions inherited from TensorBase< WR2 >
void validate_shapes_and_dims () const
 Validate shapes and dimensions.
 

Additional Inherited Members

- Public Types inherited from PrimitiveTensor< WR2, 3 >
using base_sizes_sequence
 Base shape sequence.
 
- Static Public Attributes inherited from PrimitiveTensor< WR2, 3 >
static const TensorShape const_base_sizes
 The base shape.
 
static constexpr Size const_base_dim
 The base dim.
 
static constexpr Size const_base_numel
 The base numel.
 
- Static Protected Member Functions inherited from UserTensorBase< WR2 >
static std::string tensor_type ()
 A human-readable description of the tensor type.
 

Constructor & Destructor Documentation

◆ FillWR2()

FillWR2 ( const OptionSet & options)

Member Function Documentation

◆ expected_options()

OptionSet expected_options ( )
static

◆ make()

WR2 make ( ) const
overrideprotectedvirtual

Create the tensor given input options.

Implements UserTensorBase< WR2 >.