Add get_ids to GradStore (#2379)

This commit is contained in:
Takanori MAEHARA
2024-08-01 09:56:13 +01:00
committed by GitHub
parent 1ba87a9450
commit ce90287f45

View File

@ -756,4 +756,9 @@ impl GradStore {
}; };
Ok(grad) Ok(grad)
} }
/// Get the tensor ids of the stored gradient tensors
pub fn get_ids(&self) -> impl Iterator<Item = &TensorId> {
self.0.keys()
}
} }