recent article
remove()list.remove(value)list = [2, 3, 4, 5, 6, 3] print(list)>> [2, 3, 4, 5, 6, 3]list.remove(3)print(list)>>[2, 4, 5, 6, 3]del()del list[index]list = [2, 3, 4, 5, 6, 3] print(list)>> [2, 3, 4, 5, 6, 3]del list[2]print(list)>...…
•
computer science deep learning python blogread
previous article
Some frequent one-hot method in PyTorchuse scatter_ functionlabels = [0, 1, 4, 7, 3, 2]one_hot = torch.zeros(6, 8).scatter_(dim = 1, index = labels, value = 1)use index_select() funtionlabels = [0, 1, 4, 7, 3, 2]index = torch.eye(8)one_hot = torch...…
•
computer science deep learning pytorch blogread