MCPcopy Create free account
hub / github.com/Monalissaa/DisenDiff / __init__

Method __init__

clip/model.py:202–206  ·  view source on GitHub ↗
(self, width: int, layers: int, heads: int, attn_mask: torch.Tensor = None)

Source from the content-addressed store, hash-verified

200
201class Transformer(nn.Module):
202 def __init__(self, width: int, layers: int, heads: int, attn_mask: torch.Tensor = None):
203 super().__init__()
204 self.width = width
205 self.layers = layers
206 self.resblocks = nn.Sequential(*[ResidualAttentionBlock(width, heads, attn_mask) for _ in range(layers)])
207
208 def forward(self, x: torch.Tensor):
209 return self.resblocks(x)

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45

Tested by

no test coverage detected