def net(X): return softmax(torch.matmul(X.reshape((-1, W.shape[0])), W) + b)
W在3.6.1中已定义,是全局的,不必传入net