y12= F.softmax(x1,dim = 1)#对每一行进行softmax --- dim = 1轴print(y12) y120= F.softmax(x1,dim = -1)#对每一行进行softmax --- dim = -1print(y120)>>tensor([[0.0321, 0.0871, 0.2369, 0.6439], [0.0120, 0.0889, 0.2418, 0.6572], [0.0321, 0.0871, 0.2369, 0.6439]]) tensor([[...
y120 = F.softmax(x1,dim = -1) #对每⼀⾏进⾏softmax --- dim = -1 print(y120)#对每⼀列进⾏softmax for j in range(c):sum_i = 0 for i in range(r):ins = x1_num[i,j]sum_i += math.exp(ins)for i in range(r):out_i = math.exp(x1_num[i,j])/sum_i Clo_...