Skip to content

Instantly share code, notes, and snippets.

@xiabingquan
xiabingquan / flash_attention_in_numpy.py
Last active September 3, 2024 00:55
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