Using your code, I get normalized value in the range [0, 1]:
train_numpy_data = np.random.randint(0, 500, (480, 512, 512))
train_numpy_target = np.random.randint(0, 4, (480, 512, 512))
    
traindataset = trainDataset(train_numpy_data, train_numpy_target ,transform = transform)
trainloader = torch.utils.data.DataLoader(traindataset, batch_size = 4, shuffle=True, num_workers=0, pin_memory=False)

inputs, masks = next(iter(trainloader))
print(inputs.shape, masks.shape)
> torch.Size([4, 1, 512, 512]) torch.Size([4, 512, 512])
print(inputs.min(), inputs.max())
> tensor(0.) tensor(1.)
print(masks.min(), masks.max())
> tensor(0.) tensor(1.)

However, you are also normalizing the masks, which would be wrong for a classification use case.
If you would like to get rid of unwanted classes, you should follow the code snippet given before:
background_class_index = 0
desired_class_index = 3
train_numpy_target[train_numpy_target!=desired_class_index] = background_class_index
train_numpy_target[train_numpy_target==desired_class_index] = 1