Skip to content

Instantly share code, notes, and snippets.

@xiabingquan
xiabingquan / flash_attention_in_numpy.py
Last active April 11, 2025 02:03
An toy example of flash attention implemented in Numpy.
# A minimal exmaple of flash attention implemented in Numpy
# Contact: bingquanxia AT qq.com
import unittest
from typing import List
import numpy as np
import torch