Skip to content

Instantly share code, notes, and snippets.

View mshr-h's full-sized avatar
🏠
Working from home

Masahiro Hiramori mshr-h

🏠
Working from home
View GitHub Profile
@mshr-h
mshr-h / flash_attention_in_numpy.py
Created October 14, 2024 12:20 — forked from xiabingquan/flash_attention_in_numpy.py
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