Make Param.id public (#1859)

* Make Param.id public

* Remove extra comment.
This commit is contained in:
Arthur Brussee 2024-06-06 16:03:14 +01:00 committed by GitHub
parent d28183c7e4
commit 675f6b3280
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 1 deletions

View File

@ -31,7 +31,8 @@ use core::ops::Deref;
/// let module = module.load_record(record);
/// ```
pub struct Param<T: Parameter> {
pub(crate) id: ParamId,
/// The unique ID of this parameter. This is used by eg. optimizers to associate a gradient with a specific parameter.
pub id: ParamId,
state: OnceCell<T>,
/// The locking is only required because of `lazy_device` and `lazy_is_require_grad`.
///