MCPcopy Create free account
hub / github.com/OpenDriveLab/ReSim / __init__

Method __init__

sat/sgm/modules/encoders/traj_encoder.py:80–87  ·  view source on GitHub ↗
(self, dim, depth, heads, dim_head, mlp_dim, dropout = 0.)

Source from the content-addressed store, hash-verified

78
79class Transformer(nn.Module):
80 def __init__(self, dim, depth, heads, dim_head, mlp_dim, dropout = 0.):
81 super().__init__()
82 self.layers = nn.ModuleList([])
83 for _ in range(depth):
84 self.layers.append(nn.ModuleList([
85 Attention(dim, heads = heads, dim_head = dim_head, dropout = dropout),
86 FeedForward(dim, mlp_dim, dropout = dropout)
87 ]))
88 def forward(self, x):
89 for attn, ff in self.layers:
90 x = attn(x) + x

Callers

nothing calls this directly

Calls 4

appendMethod · 0.80
AttentionClass · 0.70
FeedForwardClass · 0.70
__init__Method · 0.45

Tested by

no test coverage detected