Parameter#

API#

class warp_nn.modules.parameter.Parameter(data: array, *, requires_grad: bool = True)[source]#

Bases: object

Class representing a learnable parameter.

Note

All learnable parameters in a Module are of the Parameter type.

Parameters:
  • data – The underlying data container (array) of the parameter.

  • requires_grad – Whether the parameter requires gradients.

to(
device: Device,
) Parameter[source]#

Move the parameter to the specified device.

Parameters:

device – The device to move the parameter to.

Returns:

The parameter itself.

property data: array[source]#

The underlying data container (array) of the parameter.

property device: Device[source]#

Device on which the parameter is allocated.

property dtype: type[source]#

Data type of the parameter.

property requires_grad: bool[source]#

Whether the parameter requires gradients.

property shape: tuple[int, ...][source]#

Shape of the parameter.