题库
/
手撕 Self-Attention
手撕 Self-Attention
Hard
经典手撕
transformer
deep-learning
attention
题目描述
题目描述
实现 Scaled Dot-Product Attention 机制。
思路分析
Q、K、V 三个矩阵,计算 softmax(QK^T / sqrt(d_k)) * V。
solution.py
保存
运行
输出
点击「运行」按钮执行代码
历史提交