I’m not sure what your workflow is, as you are initializing the parameter in each forward pass, thus removing whatever was changed during training.
If you don’t need to update this parameter, you might just use a plain tensor for its operations.