请按照下方说明实现 flash_attention()。
B, H <= 2;S <= 64;D = 8,全为 float32。
S=8 基础用例
正确性调用
flash_attention(tensor[1, 1, 8, 8] [0.036121, -1.45034, -0.789562, 1.59267, 1.41186, -1.32132, …], tensor[1, 1, 8, 8] [-0.249996, 0.860874, 1.49585, -1.0952, -1.3753, 1.83971, …], tensor[1, 1, 8, 8] [0.601557, 0.655283, -0.008637, 1.14509, 0.532917, 1.62314, …])
预期结果
tensor[1, 1, 8, 8] [0.601557, 0.655283, -0.008637, 1.14509, 0.532917, 1.62314, …]
运行会检查可见示例,提交会运行完整的隐藏测试。
登录并提交后,你的提交记录会显示在这里。