对比：①     def masking_fea(self, z, event_z, event_x, event_x2, ratio=0.8):
        b, nz, c = z.shape
        b, nez, c = event_z.shape
        b, nex, c = event_x.shape
        b, nex2, c = event_x2.shape
        assert (nz == nez)
        assert (nex == nex2)
        lenz_out = int(nz * ratio)
        lenx_out = int(nex * ratio)
        
        mask_nz = torch.rand(b, nz).float()
        mask_ez = torch.rand(b, nez).float()
        mask_nx = torch.rand(b, nex).float()
        mask_ex2 = torch.rand(b, nex2).float()
        
        mask_nz = mask_nz > 0.4
        mask_ez = mask_ez > 0.4
        mask_ez = ~mask_nz + mask_ez
        mask_nz_idx = mask_nz.float().sort(1, descending=True)[-1].to(device=z.device)
        mask_ez_idx = mask_ez.float().sort(1, descending=True)[-1].to(device=z.device)
        
        mask_nx = mask_nx > 0.4
        mask_ex2 = mask_ex2 > 0.4
        mask_ex2 = ~mask_nx + mask_ex2
        mask_nx_idx = mask_nx.float().sort(1, descending=True)[-1].to(device=z.device)
        mask_ex2_idx = mask_ex2.float().sort(1, descending=True)[-1].to(device=z.device)
    
        masked_z = torch.gather(z, 1, mask_nz_idx[:, :lenz_out, None].repeat([1, 1, c]))
        masked_ez = torch.gather(event_z, 1, mask_ez_idx[:, :lenz_out, None].repeat([1, 1, c]))
        masked_x = torch.gather(event_x, 1, mask_nx_idx[:, :lenx_out, None].repeat([1, 1, c]))
        masked_ex2 = torch.gather(event_x2, 1, mask_ex2_idx[:, :lenx_out, None].repeat([1, 1, c]))

        tokens_mask = {
            'x1': mask_nx_idx[:, :lenx_out],
            'x0': mask_nx_idx[:, lenx_out:],
            'ex1': mask_ex2_idx[:, :lenx_out],
            'ex0': mask_ex2_idx[:, lenx_out:]
        } 和 ②    def masking_fea(self,z, event_z, x, event_x, ratio=0.8 ):
        b,nz,c = z.shape
        b,nez,c = event_z.shape
        b,nx,c = x.shape
        b,nex,c = event_x.shape
        assert(nz == nez)
        assert(nx == nex)
        lenz_out = int(nz*ratio)
        lenx_out = int(nx*ratio)

        mask_nz = torch.rand(b,nz).float()
        mask_ez = torch.rand(b,nez).float()
        mask_nx = torch.rand(b,nx).float()
        mask_ex = torch.rand(b,nex).float()
        mask_nz = mask_nz>0.4
        mask_ez = mask_ez>0.4
        mask_ez = ~mask_nz + mask_ez
        mask_nz_idx = mask_nz.float().sort(1,descending=True)[-1].to(device = z.device)
        mask_ez_idx = mask_ez.float().sort(1,descending=True)[-1].to(device = z.device)
        mask_nx = mask_nx>0.4
        mask_ex = mask_ex>0.4
        mask_ex = ~mask_nx + mask_ex
        mask_nx_idx = mask_nx.float().sort(1,descending=True)[-1].to(device = z.device)
        mask_ex_idx = mask_ex.float().sort(1,descending=True)[-1].to(device = z.device)

        masked_z = torch.gather(z, 1, mask_nz_idx[:,:lenz_out,None].repeat([1,1,c]))
        masked_ez = torch.gather(event_z, 1, mask_ez_idx[:,:lenz_out,None].repeat([1,1,c]))
        masked_x = torch.gather(x, 1, mask_nx_idx[:,:lenx_out,None].repeat([1,1,c]))
        masked_ex = torch.gather(event_x, 1, mask_ex_idx[:,:lenx_out,None].repeat([1,1,c]))
        return masked_z, masked_ez, masked_x, masked_ex,{'x1':mask_nx_idx[:,:lenx_out],'x0':mask_nx_idx[:,lenx_out:],
                                                        'ex1':mask_ex_idx[:,:lenx_out],'ex0':mask_ex_idx[:,lenx_out:], }