If I understand correctly, you just want to generate a tensor which contains -1 and 1 values ?
Would something like this work for you ?
a = torch.Tensor([-1, 1])
idx = np.random.randint(2, size=your_shape)
noise = a[idx]

Edit :
Furthermore, if you want to have some control on the number of 1 or -1 in your tensor, I would suggest:
a = torch.Tensor([-1, 1])
idx = np.random.choice(2, size=your_shape, p=[r, 1-r])
noise = a[idx]