My intuitions is: this is a bug in PyTorch. Consider this code:
        object_estimate = self.moduleSix(pyramid_first[-1], pyramid_second[-1], None)
        flow6 = object_estimate['flow']

        mask2 = torch.load("mask.pt")
        mask2[mask2 > 0.999] = 1.0 # <-- No error here...

        object_estimate = self.moduleFiv(pyramid_first[-2], pyramid_second[-2], object_estimate)
        flow5 = object_estimate['flow']

        mask2 = torch.load("mask.pt")
        mask2[mask2 > 0.999] = 1.0 # <-- Error here...

mask2, in both cases, is just a copy of the mask tensor I provide & talk about above loaded from disk. moduleFiv and moduleSix are Decoder objects based on torch.nn.Module, which vary only by in_channels counts to their convolutional layers.