Skip to content

Instantly share code, notes, and snippets.

View hyeonbeenlee's full-sized avatar

Hyeonbeen Lee hyeonbeenlee

View GitHub Profile
@andrewliao11
andrewliao11 / layernorm.py
Last active March 1, 2023 08:54
simple lstm cell with layernorm
# using pytorch==0.4.0
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.nn.parameter import Parameter
from torch.nn.modules.rnn import RNNCellBase
from torch.nn._functions.thnn import rnnFusedPointwise as fusedBackend