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 void requires_grad_ (bool req=true) override
 Require grad.
 
virtual operator Tensor () const override
 Convert the parameter value to a Tensor.
 
virtual void operator= (const Tensor &val) override
 assignment operator
 
virtual TensorType type () const override
 Tensor type.
 
T & 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)
inlineexplicit

Member Function Documentation

◆ operator Tensor()

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

Convert the parameter value to a Tensor.

Implements TensorValueBase.

◆ operator=()

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

assignment operator

Implements TensorValueBase.

◆ requires_grad_()

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

Require grad.

Implements TensorValueBase.

◆ to_()

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

Send the value to the target options.

Implements TensorValueBase.

◆ type()

template<typename T >
virtual TensorType type ( ) const
inlineoverridevirtual

Tensor type.

Implements TensorValueBase.

◆ value()

template<typename T >
T & value ( )
inline