import torch
import torch.nn as nn
input = torch.randn(3, 3)
#print(input)
sm = nn.Softmax(dim=1)
sl = nn.LogSoftmax(dim=1)
#print(sm(input))
test1 = torch.log(sm(input))
print(test1)
print(sl(input))
print(test1[1][2])
print(abs(test1[0][0] + test1[1][2] + test1[2][1]) / 3)
loss = nn.NLLLoss()
target = torch.tensor([0, 2, 1])
l1 = loss(test1, target)
print(l1)
loss_1 = nn.CrossEntropyLoss()
print(loss_1(input, target))
target = torch.tensor([0])
print(target)
x,y= 2,3
print(x,y)