How to use argument fill in Pad

https://pytorch.org/vision/main/generated/torchvision.transforms.Pad.html#pad

I want to use this function and specify a color. The doc says fill accepts a tuple, but the following code does not work:

    image = read_image(img_path)
    # pad image
    _, height, width = image.shape
    pad_left = (self.max_width - width) // 2
    pad_right = self.max_width - width - pad_left
    pad_top = (self.max_height - height) // 2
    pad_bottom = self.max_height - height - pad_top
    # fill = 0 if img_path.startswith("sndn") else 255  
    fill = tuple(image[:,0,-1].tolist()) <----- here
    print(fill)
    image = F.pad(image, (pad_left, pad_top, pad_right, pad_bottom), fill=fill)

I am passing a tuple but the code outputs “Got inappropriate fill arg”. How am I supposed to specify a color?