finished a first pass at digesting the paper, start with transformer

This commit is contained in:
lucidrains 2025-10-01 09:21:55 -07:00
parent e0dd4cfeaa
commit 8ebb8a9661

View File

@ -1,8 +1,22 @@
from __future__ import annotations
import math
from functools import partial
import torch
import torch.nn.functional as F
from torch.nn import Module, ModuleList, RMSNorm, Identity
from torch.nn import Module, ModuleList, Linear, RMSNorm, Identity
from torch import cat, stack, tensor, Tensor, is_tensor
# ein related
from einops import einsum, rearrange, repeat, reduce
from einops.layers.torch import Rearrange
# constants
LinearNoBias = partial(Linear, bias = False)
# helpers
def exists(v):