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

The base class to allow us to set up a polymorphic container of BatchTensors. 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 BatchTensors. The concrete definitions will be templated on the actual tensor type.

#include <TensorValue.h>

Inheritance diagram for TensorValueBase:

Public Member Functions

virtual ~TensorValueBase ()=default
 
virtual void to (const torch::TensorOptions &)=0
 Send the value to the target options.
 
virtual operator BatchTensor () const =0
 Convert the parameter value to a BatchTensor.
 
virtual void set (const BatchTensor &val)=0
 Set the parameter value.
 

Constructor & Destructor Documentation

◆ ~TensorValueBase()

virtual ~TensorValueBase ( )
virtualdefault

Member Function Documentation

◆ operator BatchTensor()

virtual operator BatchTensor ( ) const
pure virtual

Convert the parameter value to a BatchTensor.

Implemented in TensorValue< T >.

◆ set()

virtual void set ( const BatchTensor & val)
pure virtual

Set the parameter value.

Implemented in TensorValue< T >.

◆ to()

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

Send the value to the target options.

Implemented in TensorValue< T >.