Created
July 27, 2022 14:20
-
-
Save Steboss89/fee57a264b2b738b4b3f0d2e649effb5 to your computer and use it in GitHub Desktop.
reinitialised an existing tensor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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