There cannot be any in-place assignment, like:
pred[:, :, 0] = torch.sigmoid(pred[:, :, 0])

I think that you need to modify it as:
pred = torch.cat((torch.sigmoid(pred[:, :, 0:1]), pred[:, :, 1:]), dim=2)

Anyway, slicing cannot occur on the left side of “=”