Skip to content

Instantly share code, notes, and snippets.

@Steboss89
Created July 27, 2022 14:20
Show Gist options
  • Save Steboss89/fee57a264b2b738b4b3f0d2e649effb5 to your computer and use it in GitHub Desktop.
Save Steboss89/fee57a264b2b738b4b3f0d2e649effb5 to your computer and use it in GitHub Desktop.
reinitialised an existing tensor
impl Init {
/// Re-initializes an existing tensor with the specified initialization
pub fn set(self, tensor: &mut Tensor) {
match self {
Init::Const(cst) => {
let _ = tensor.fill_(cst);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment