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

Method __init__

model/model_utils.py:77–105  ·  view source on GitHub ↗
(self, opt: Options, **kwargs)

Source from the content-addressed store, hash-verified

75
76class SplatDecoder(nn.Module):
77 def __init__(self, opt: Options, **kwargs):
78 super().__init__()
79
80 self.opt = opt
81 self.width = opt.decoder_hidden_dim
82 self.patch_size = opt.patch_size
83 self.input_res = opt.down_resolution
84 self.num_layers = opt.decoder_num_layers
85
86 if len(opt.down_resolution) > 0:
87 self.actual_input_res = opt.down_resolution
88 else:
89 self.actual_input_res = (opt.image_height, opt.image_width)
90
91 self.transformer_decoder = TransformerConditionalDecoder(
92 input_res=self.actual_input_res,
93 patch_size=self.patch_size,
94 layers=self.num_layers,
95 width=self.width,
96 heads=self.width // 64,
97 window_size=opt.bwindow_size,
98 condition_dim=opt.hidden_dim,
99 condition_len=576 if opt.use_dino else 2304,
100 encoder_dim=opt.hidden_dim,
101 drop_path_rate=opt.drop_path_rate,
102 )
103 self.token_len = (self.actual_input_res[0] // self.patch_size) * (self.actual_input_res[1] // self.patch_size)
104
105 self.transformer_decoder.set_grad_checkpointing(opt.checkpointing)
106
107 def forward(self, latent, condition=None):
108 features = self.transformer_decoder(latent, condition) # [B, V, N, D]

Callers

nothing calls this directly

Calls 3

__init__Method · 0.45

Tested by

no test coverage detected