def softmax(X): X_exp = torch.exp(X) partition = X_exp.sum(1, keepdims=True) return X_exp / partition # The broadcasting mechanism is applied here
確定! 回上一頁