NEML2 1.4.0
Loading...
Searching...
No Matches
TensorValue Class Reference

Detailed Description

The interface for working with tensor values (parameters, buffers, etc.) managed by models.

Public Member Functions

None requires_grad_ (self, bool req=True)
 
None set_ (self, tensors.Tensor arg0)
 
tensors.Tensor tensor (self)
 
torch.Tensor torch (self)
 
torch.Tensor grad (self)
 
bool requires_grad (self)
 

Member Function Documentation

◆ grad()

torch.Tensor grad ( self)
Retrieve the accumulated vector-Jacobian product after a backward propagation.

◆ requires_grad()

bool requires_grad ( self)
Value of the boolean requires_grad property of the underlying tensor.

◆ requires_grad_()

None requires_grad_ ( self,
bool req = True )
Set the requires_grad property of the underlying tensor.

◆ set_()

None set_ ( self,
tensors.Tensor arg0 )
Modify the underlying tensor data.

◆ tensor()

tensors.Tensor tensor ( self)
Convert this to a tensors.Tensor.

This conversion takes ownership of the tensor, and so any modification to the
returned tensors.Tensor does not affect the original tensors.TensorValue. Use
tensors.TensorValue.set_ instead to modify the tensor value.

◆ torch()

torch.Tensor torch ( self)
Convert this to a torch.Tensor.

This conversion takes ownership of the tensor, and so any modification to the
returned torch.Tensor does not affect the original tensors.TensorValue. Use
tensors.TensorValue.set_ instead to modify the tensor value.