init commit
This commit is contained in:
14
nanovllm/layers/activation.py
Executable file
14
nanovllm/layers/activation.py
Executable file
@@ -0,0 +1,14 @@
|
||||
import torch
|
||||
from torch import nn
|
||||
import torch.nn.functional as F
|
||||
|
||||
|
||||
class SiluAndMul(nn.Module):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
@torch.compile
|
||||
def forward(self, x: torch.Tensor) -> torch.Tensor:
|
||||
x, y = x.chunk(2, -1)
|
||||
return F.silu(x) * y
|
||||
Reference in New Issue
Block a user