Files
nano-vllm/nanovllm/layers/activation.py
T
GeekExplorer 9e8507ef41 minor simplify
2026-04-13 22:09:46 +08:00

12 lines
232 B
Python
Executable File

import torch
from torch import nn
import torch.nn.functional as F
class SiluAndMul(nn.Module):
@torch.compile
def forward(self, x: torch.Tensor) -> torch.Tensor:
x, y = x.chunk(2, -1)
return F.silu(x) * y