.numpy() on the input batch, and transform the data using scipy as you wish. If it is CPU tensor, data pointer is shared between torch.Tensor and it’s corresponding ndarray generated with
See for example:
x = torch.Tensor([1, 2, 3])
y = x.numpy()
# see that y has also changed if you added something to x
y += 1
# changing y in-place also changes x.