IgANet
IgANets - Isogeometric Analysis Networks
Loading...
Searching...
No Matches
iganet::Options< real_t > Class Template Reference

The Options class handles the automated determination of dtype from the template argument and the selection of the device. More...

#include </home/runner/work/iganet/iganet/include/options.hpp>

Inheritance diagram for iganet::Options< real_t >:
iganet::utils::FullQualifiedName iganet::Options< Options< real_t > >

Public Types

using value_type = real_t
 Data type.
 

Public Member Functions

 Options ()
 Default constructor.
 
 Options (torch::TensorOptions &&options)
 Constructor from torch::TensorOptions.
 
torch::Device device () const noexcept
 Returns the device property.
 
Options< real_t > device (torch::Device device) const noexcept
 Returns a new Options object with the device property as given.
 
int32_t device_index () const noexcept
 Returns the device_index property.
 
Options< real_t > device_index (int16_t device_index) const noexcept
 Returns a new Options object with the device_index property as given.
 
torch::Dtype dtype () const noexcept
 Returns the dtype property.
 
template<typename other_t >
Options< other_tdtype () const noexcept
 Returns a new Options object with the dtype property as given.
 
bool is_sparse () const noexcept
 Returns if the layout is sparse.
 
torch::Layout layout () const noexcept
 Returns the layout property.
 
Options< real_t > layout (torch::Layout layout) const noexcept
 Returns a new Options object with the layout property as given.
 
Options< real_t > memory_format (torch::MemoryFormat memory_format) const noexcept
 Returns a new Options object with the memory_format property as given.
 
 operator torch::TensorOptions () const
 Implicit conversion operator.
 
bool pinned_memory () const noexcept
 Returns the pinned_memory property.
 
Options< real_t > pinned_memory (bool pinned_memory) const noexcept
 Returns a new Options object with the pinned_memory property as given.
 
virtual void pretty_print (std::ostream &os=Log(log::info)) const noexcept override
 Returns a string representation of the Options object.
 
bool requires_grad () const noexcept
 Returns the requires_grad property.
 
Options< real_t > requires_grad (bool requires_grad) const noexcept
 Returns a new Options object with the requires_grad property as given.
 

Private Attributes

const torch::TensorOptions options_
 Tensor options.
 
- Private Attributes inherited from iganet::utils::FullQualifiedName
at::optional< std::string > name_
 String storing the full qualified name of the object.
 

Additional Inherited Members

- Private Member Functions inherited from iganet::utils::FullQualifiedName
virtual const std::string & name () const noexcept
 Returns the full qualified name of the object.
 

Detailed Description

template<typename real_t>
class iganet::Options< real_t >

The Options class handles the automated determination of dtype from the template argument and the selection of the device.

Template Parameters
real_tType of real-valued data

Member Typedef Documentation

◆ value_type

template<typename real_t >
using iganet::Options< real_t >::value_type = real_t

Data type.

Constructor & Destructor Documentation

◆ Options() [1/2]

template<typename real_t >
iganet::Options< real_t >::Options ( )
inline

Default constructor.

◆ Options() [2/2]

template<typename real_t >
iganet::Options< real_t >::Options ( torch::TensorOptions< real_t > &&  options)
inlineexplicit

Constructor from torch::TensorOptions.

Member Function Documentation

◆ device() [1/2]

template<typename real_t >
torch::Device iganet::Options< real_t >::device ( ) const
inlinenoexcept

Returns the device property.

◆ device() [2/2]

template<typename real_t >
Options< real_t > iganet::Options< real_t >::device ( torch::Device  device) const
inlinenoexcept

Returns a new Options object with the device property as given.

◆ device_index() [1/2]

template<typename real_t >
int32_t iganet::Options< real_t >::device_index ( ) const
inlinenoexcept

Returns the device_index property.

◆ device_index() [2/2]

template<typename real_t >
Options< real_t > iganet::Options< real_t >::device_index ( int16_t  device_index) const
inlinenoexcept

Returns a new Options object with the device_index property as given.

◆ dtype() [1/2]

template<typename real_t >
torch::Dtype iganet::Options< real_t >::dtype ( ) const
inlinenoexcept

Returns the dtype property.

◆ dtype() [2/2]

template<typename real_t >
template<typename other_t >
Options< other_t > iganet::Options< real_t >::dtype ( ) const
inlinenoexcept

Returns a new Options object with the dtype property as given.

◆ is_sparse()

template<typename real_t >
bool iganet::Options< real_t >::is_sparse ( ) const
inlinenoexcept

Returns if the layout is sparse.

◆ layout() [1/2]

template<typename real_t >
torch::Layout iganet::Options< real_t >::layout ( ) const
inlinenoexcept

Returns the layout property.

◆ layout() [2/2]

template<typename real_t >
Options< real_t > iganet::Options< real_t >::layout ( torch::Layout  layout) const
inlinenoexcept

Returns a new Options object with the layout property as given.

◆ memory_format()

template<typename real_t >
Options< real_t > iganet::Options< real_t >::memory_format ( torch::MemoryFormat  memory_format) const
inlinenoexcept

Returns a new Options object with the memory_format property as given.

◆ operator torch::TensorOptions()

template<typename real_t >
iganet::Options< real_t >::operator torch::TensorOptions ( ) const
inline

Implicit conversion operator.

◆ pinned_memory() [1/2]

template<typename real_t >
bool iganet::Options< real_t >::pinned_memory ( ) const
inlinenoexcept

Returns the pinned_memory property.

◆ pinned_memory() [2/2]

template<typename real_t >
Options< real_t > iganet::Options< real_t >::pinned_memory ( bool  pinned_memory) const
inlinenoexcept

Returns a new Options object with the pinned_memory property as given.

◆ pretty_print()

template<typename real_t >
virtual void iganet::Options< real_t >::pretty_print ( std::ostream &  os = Log(log::info)) const
inlineoverridevirtualnoexcept

Returns a string representation of the Options object.

Implements iganet::utils::FullQualifiedName.

◆ requires_grad() [1/2]

template<typename real_t >
bool iganet::Options< real_t >::requires_grad ( ) const
inlinenoexcept

Returns the requires_grad property.

◆ requires_grad() [2/2]

template<typename real_t >
Options< real_t > iganet::Options< real_t >::requires_grad ( bool  requires_grad) const
inlinenoexcept

Returns a new Options object with the requires_grad property as given.

Member Data Documentation

◆ options_

template<typename real_t >
const torch::TensorOptions iganet::Options< real_t >::options_
private

Tensor options.


The documentation for this class was generated from the following file: