NEML2 2.0.0
Loading...
Searching...
No Matches
TensorValueBase Class Referenceabstract

The base class to allow us to set up a polymorphic container of Tensors. The concrete definitions will be templated on the actual tensor type. More...

Detailed Description

The base class to allow us to set up a polymorphic container of Tensors. The concrete definitions will be templated on the actual tensor type.

#include <TensorValue.h>

Inheritance diagram for TensorValueBase:

Public Member Functions

 TensorValueBase ()=default
 
 TensorValueBase (const TensorValueBase &)=default
 
 TensorValueBase (TensorValueBase &&) noexcept=default
 
TensorValueBaseoperator= (const TensorValueBase &)=default
 
TensorValueBaseoperator= (TensorValueBase &&) noexcept=default
 
virtual ~TensorValueBase ()=default
 
virtual void to_ (const torch::TensorOptions &)=0
 Send the value to the target options.
 
virtual void requires_grad_ (bool req=true)=0
 Require grad.
 
virtual operator Tensor () const =0
 Convert the parameter value to a Tensor.
 
virtual void operator= (const Tensor &val)=0
 assignment operator
 
virtual TensorType type () const =0
 Tensor type.
 

Constructor & Destructor Documentation

◆ TensorValueBase() [1/3]

TensorValueBase ( )
default

◆ TensorValueBase() [2/3]

◆ TensorValueBase() [3/3]

TensorValueBase ( TensorValueBase && )
defaultnoexcept

◆ ~TensorValueBase()

virtual ~TensorValueBase ( )
virtualdefault

Member Function Documentation

◆ operator Tensor()

virtual operator Tensor ( ) const
pure virtual

Convert the parameter value to a Tensor.

Implemented in TensorValue< T >.

◆ operator=() [1/3]

virtual void operator= ( const Tensor & val)
pure virtual

assignment operator

Implemented in TensorValue< T >.

◆ operator=() [2/3]

◆ operator=() [3/3]

TensorValueBase & operator= ( TensorValueBase && )
defaultnoexcept

◆ requires_grad_()

virtual void requires_grad_ ( bool req = true)
pure virtual

Require grad.

Implemented in TensorValue< T >.

◆ to_()

virtual void to_ ( const torch::TensorOptions & )
pure virtual

Send the value to the target options.

Implemented in TensorValue< T >.

◆ type()

virtual TensorType type ( ) const
pure virtual

Tensor type.

Implemented in TensorValue< T >.