MCPcopy Create free account
hub / github.com/openai/point-e / MLP

Class MLP

point_e/models/transformer.py:51–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49
50
51class MLP(nn.Module):
52 def __init__(self, *, device: torch.device, dtype: torch.dtype, width: int, init_scale: float):
53 super().__init__()
54 self.width = width
55 self.c_fc = nn.Linear(width, width * 4, device=device, dtype=dtype)
56 self.c_proj = nn.Linear(width * 4, width, device=device, dtype=dtype)
57 self.gelu = nn.GELU()
58 init_linear(self.c_fc, init_scale)
59 init_linear(self.c_proj, init_scale)
60
61 def forward(self, x):
62 return self.c_proj(self.gelu(self.c_fc(x)))
63
64
65class QKVMultiheadAttention(nn.Module):

Callers 3

__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected