NEML2 1.4.0
Loading...
Searching...
No Matches
TensorValue< T > Class Template Reference

Concrete definition of tensor value. More...

Detailed Description

template<typename T>
class neml2::TensorValue< T >

Concrete definition of tensor value.

#include <TensorValue.h>

Inheritance diagram for TensorValue< T >:

Public Member Functions

 TensorValue ()=default
 
 TensorValue (const T &value)
 
virtual void to (const torch::TensorOptions &options) override
 Send the value to the target options.
 
virtual operator BatchTensor () const override
 Convert the parameter value to a BatchTensor.
 
template<typename T2 = T, typename = typename std::enable_if_t<!std::is_same_v<T2, BatchTensor>>>
 operator T () const
 
T & value ()
 
virtual void set (const BatchTensor &val) override
 Set the parameter value.
 
- Public Member Functions inherited from TensorValueBase
virtual ~TensorValueBase ()=default
 

Constructor & Destructor Documentation

◆ TensorValue() [1/2]

template<typename T >
TensorValue ( )
default

◆ TensorValue() [2/2]

template<typename T >
TensorValue ( const T & value)
inline

Member Function Documentation

◆ operator BatchTensor()

template<typename T >
virtual operator BatchTensor ( ) const
inlineoverridevirtual

Convert the parameter value to a BatchTensor.

Implements TensorValueBase.

◆ operator T()

template<typename T >
template<typename T2 = T, typename = typename std::enable_if_t<!std::is_same_v<T2, BatchTensor>>>
operator T ( ) const
inline

◆ set()

template<typename T >
virtual void set ( const BatchTensor & val)
inlineoverridevirtual

Set the parameter value.

Implements TensorValueBase.

◆ to()

template<typename T >
virtual void to ( const torch::TensorOptions & )
inlineoverridevirtual

Send the value to the target options.

Implements TensorValueBase.

◆ value()

template<typename T >
T & value ( )
inline