Another solution would be to directly use PIL’s ImageFilter.GaussianBlur 134 transform.
You can then create the transform:
import numbers
import numpy as np
from PIL import ImageFilter

class GaussianSmoothing(object):
    def __init__(self, radius):
        if isinstance(radius, numbers.Number):
            self.min_radius = radius
            self.max_radius = radius
        elif isinstance(radius, list):
            if len(radius) != 2:
                raise Exception(
                    "`radius` should be a number or a list of two numbers")
            if radius[1] < radius[0]:
                raise Exception(
                    "radius[0] should be <= radius[1]")
            self.min_radius = radius[0]
            self.max_radius = radius[1]
        else:
            raise Exception(
                "`radius` should be a number or a list of two numbers")

    def __call__(self, image):
        radius = np.random.uniform(self.min_radius, self.max_radius)
        return image.filter(ImageFilter.GaussianBlur(radius))

Then you can simply add it to your composed transform before ToTensor():
from PIL import Image
import torchvision.transforms as T

# just add it before ToTensor(), which is ommited here 
transform = T.Compose([
    GaussianSmoothing([0, 5])
]) 

TEST_IMG = "path/to/image"
img = Image.open(TEST_IMG)
img_t = transform(img)

img_t.show()