If you would like to create a Gaussian window (not sample from the Gaussian distribution), you could use e.g. scipy.signal.gaussian 5 to create the values and transform it to a tensor via torch.from_numpy(signal).