Skip to content

Instantly share code, notes, and snippets.

View chao-ji's full-sized avatar
:octocat:

chao-ji

:octocat:
View GitHub Profile
@chao-ji
chao-ji / learning-triton-strides-and-offsets.ipynb
Created June 9, 2024 12:16
Learning Triton: Strides and Offsets.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chao-ji
chao-ji / beamsearch_decoder.py
Last active March 4, 2024 07:09
Easy to understand implementation of beam search algorithm used in decoder of seq2seq models
"""NumPy implementation of Beam Search. Can be used for decoding in Seq2Seq
models or transformer.
See https://chao-ji.github.io/jekyll/update/2019/01/24/Beam_Search.html
for an in-depth disucssion.
"""
import numpy as np
NEG_INF = -1e9