Код: Выделить всё
input= torch.randn(100).to(device)
output = torch.where(input>=0, input, -input)
input = input.('cpu').detach().numpy().copy()
output = output.('cpu').detach().numpy().copy()
plt.plot(input,out)
Подробнее здесь: https://stackoverflow.com/questions/686 ... rch-tensor
Мобильная версия