NEML2 2.0.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 (T value)
 
void to_ (const torch::TensorOptions &options) override
 Send the value to the target options.
 
void requires_grad_ (bool req=true) override
 Require grad.
 
 operator Tensor () const override
 Convert the parameter value to a Tensor.
 
void operator= (const Tensor &val) override
 assignment operator
 
TensorType type () const override
 Tensor type.
 
T & value ()
 
- Public Member Functions inherited from TensorValueBase
 TensorValueBase ()=default
 
 TensorValueBase (const TensorValueBase &)=default
 
 TensorValueBase (TensorValueBase &&) noexcept=default
 
TensorValueBaseoperator= (const TensorValueBase &)=default
 
TensorValueBaseoperator= (TensorValueBase &&) noexcept=default
 
virtual ~TensorValueBase ()=default
 

Constructor & Destructor Documentation

◆ TensorValue()

template<typename T >
TensorValue ( T value)
inlineexplicit

Member Function Documentation

◆ operator Tensor()

template<typename T >
operator Tensor ( ) const
overridevirtual

Convert the parameter value to a Tensor.

Implements TensorValueBase.

◆ operator=()

template<typename T >
void operator= ( const Tensor & val)
overridevirtual

assignment operator

Implements TensorValueBase.

◆ requires_grad_()

template<typename T >
void requires_grad_ ( bool req = true)
overridevirtual

Require grad.

Implements TensorValueBase.

◆ to_()

template<typename T >
void to_ ( const torch::TensorOptions & )
overridevirtual

Send the value to the target options.

Implements TensorValueBase.

◆ type()

template<typename T >
TensorType type ( ) const
overridevirtual

Tensor type.

Implements TensorValueBase.

◆ value()

template<typename T >
T & value ( )
inline