MCPcopy
hub / github.com/hpcaitech/ColossalAI / Conv1D

Class Conv1D

tests/test_fx/test_coloproxy.py:10–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10class Conv1D(nn.Module):
11 def __init__(self, nf, nx):
12 super().__init__()
13 self.nf = nf
14 w = torch.empty(nx, nf)
15 nn.init.normal_(w, std=0.02)
16 self.weight = nn.Parameter(w)
17 self.bias = nn.Parameter(torch.zeros(nf))
18
19 def forward(self, x):
20 size_out = x.shape[:-1] + (self.nf,)
21 x = torch.addmm(self.bias, x.view(-1, x.size(-1)), self.weight)
22 x = x.view(size_out)
23 return x
24
25
26@clear_cache_before_run()

Callers 8

test_coloproxyFunction · 0.70
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50
__init__Method · 0.50

Calls

no outgoing calls

Tested by 4

test_coloproxyFunction · 0.56
__init__Method · 0.40
__init__Method · 0.40
__init__Method · 0.40

Used in the wild real call sites across dependent graphs

searching dependent graphs…