Skip to main content

Module

Derive Macro Module 

Source
#[derive(Module)]
{
    // Attributes available to this derive:
    #[no_param]
}
Expand description

Implements FromIterator<Item = (String, Tensor)> and Module for your struct.

This allows saving, loading, backpropagation and updating your modules.

Recognised field attributes:

  • #[no_param] — marks a Tensor / Option<Tensor> field as a non-trainable hyperparameter (or state buffer). The parameter iteration skips it.