1. Data Masked(data_sample)
import random
import torch
data = torch.FloatTensor([[1, 2, 3], [4, 5, 6], [7, 8, 9]])
print("data:")
print(data)
num_mask = 1
sample = random.sample(range(len(data)), 1)
print(sample)
index = torch.ones(data.shape, dtype=torch.bool)
index[sample]=False
print(index)
data_sample = data[index].reshape(-1, data.shape[1])
print(data_sample)