NEML2 2.0.0
Loading...
Searching...
No Matches
Model Class Reference

Detailed Description

The canonical type for constitutive models in NEML2.

Public Member Functions

TensorValue __getattr__ (self, str arg0)
 
None __setattr__ (self, str arg0, Tensor arg1)
 
str __str__ (self)
 
dict[str, Modeldependency (self)
 
dict[VariableName|str, dict[VariableName|str, Tensor]] dvalue (self, dict arg0)
 
TensorValue get_parameter (self, str arg0)
 
LabeledAxis input_axis (self, bool setup=False)
 
tensors.TensorType input_type (self, str variable)
 
dict[str, TensorValuenamed_buffers (self)
 
dict[str, TensorValuenamed_parameters (self)
 
dict[str, Modelnamed_submodels (self)
 
LabeledAxis output_axis (self, bool setup=False)
 
tensors.TensorType output_type (self, str variable)
 
None set_parameter (self, str arg0, Tensor arg1)
 
None set_parameters (self, dict[str, Tensor] arg0)
 
None to (self, *, torch.dtype dtype=..., torch.device device=..., bool requires_grad=False)
 
dict[VariableName|str, Tensor] value (self, dict arg0)
 
tuple[dict[VariableName|str, Tensor], dict[VariableName|str, dict[VariableName|str, Tensor]]] value_and_dvalue (self, dict arg0)
 
str name (self)
 
str type (self)
 

Member Function Documentation

◆ __getattr__()

TensorValue __getattr__ ( self,
str arg0 )
Get a model parameter given its name

◆ __setattr__()

None __setattr__ ( self,
str arg0,
Tensor arg1 )
Set the value for a model parameter

◆ __str__()

str __str__ ( self)

◆ dependency()

dict[str, Model] dependency ( self)
Get the dictionary describing this model's dependency information, if any.

◆ dvalue()

dict[VariableName | str, dict[VariableName | str, Tensor]] dvalue ( self,
dict arg0 )

◆ get_parameter()

TensorValue get_parameter ( self,
str arg0 )
Get a model parameter given its name

◆ input_axis()

LabeledAxis input_axis ( self,
bool setup = False )
Input axis of the model. The axis contains information on variable names and their associated slicing indices.

◆ input_type()

tensors.TensorType input_type ( self,
str variable )
Introspect the underlying tensor type of an input variable. @returns tensors.TensorType

◆ name()

str name ( self)
Name of the model

◆ named_buffers()

dict[str, TensorValue] named_buffers ( self)
Get the model buffers. The keys of the returned dictionary are the buffers' names.

◆ named_parameters()

dict[str, TensorValue] named_parameters ( self)
Get the model parameters. The keys of the returned dictionary are the parameters' names.

◆ named_submodels()

dict[str, Model] named_submodels ( self)
Get the sub-models registered to this model

◆ output_axis()

LabeledAxis output_axis ( self,
bool setup = False )
Output axis of the model. The axis contains information on variable names and their associated slicing indices.

◆ output_type()

tensors.TensorType output_type ( self,
str variable )
Introspect the underlying tensor type of an output variable. @returns tensors.TensorType

◆ set_parameter()

None set_parameter ( self,
str arg0,
Tensor arg1 )
Set the value for a model parameter

◆ set_parameters()

None set_parameters ( self,
dict[str, Tensor] arg0 )
Set the values for multiple model parameters 

◆ to()

None to ( self,
* ,
torch.dtype dtype = ...,
torch.device device = ...,
bool requires_grad = False )

◆ type()

str type ( self)
Type of the model

◆ value()

dict[VariableName | str, Tensor] value ( self,
dict arg0 )

◆ value_and_dvalue()

tuple[dict[VariableName | str, Tensor], dict[VariableName | str, dict[VariableName | str, Tensor]]] value_and_dvalue ( self,
dict arg0 )