The error here:
(torch.cuda.ZFloatTensor other)
didn’t match because some of the arguments have invalid types: (!torch.ZFloatTensor!)

is that your other is a cuda Tensor but it expects a cpu Tensor.
Are you sure both P and O_cropped are on gpu ?