MCPcopy Create free account
hub / github.com/DSL-Lab/StreamSplat / __init__

Method __init__

model/transformer_utils.py:423–429  ·  view source on GitHub ↗
(self, input_res, in_channels, patch_size, width, layers, heads, window_size)

Source from the content-addressed store, hash-verified

421
422class TransformerEncoder(TransformerBase):
423 def __init__(self, input_res, in_channels, patch_size, width, layers, heads, window_size):
424 self.input_res = input_res
425 self.patch_size = patch_size
426 token_len = (self.input_res[0] // patch_size) * (self.input_res[1] // patch_size)
427 super().__init__(width, layers, heads, window_size, token_len, ResAttBlock)
428 self.conv = nn.Conv2d(in_channels=in_channels, out_channels=width, kernel_size=patch_size, stride=patch_size, bias=False)
429 self.positional_encoding = SinusoidalPositionalEncoding(max_len=token_len, d_model=width)
430
431 def forward(self, x, condition=None):
432 _, v = x.shape[:2]

Callers

nothing calls this directly

Calls 2

__init__Method · 0.45

Tested by

no test coverage detected