大模型算法手撕题总结
# 写在前面
本文涉及到的张量计算、reshape 等操作均使用 einops 库来实现,如果你还不会使用,强烈推荐花费 5 分钟学习一下,能大幅提升代码可读性。
einops_install12345678pip install einops# 本文使用的符号含义:# b: batch size# s: sequence length# d: dimension# h: number of heads# t: 符号被占用的替代品from einops import rearrange, repeat, einsum
# 大模型相关手撕题
按重要度排序:(但一般就考个...
more...