mask = (torch.rand(12) > 0.5).int() while mask.dim() < data.dim(): mask.unsqueeze_(1) result = data * mask result.shape # torch.
確定! 回上一頁