MCPcopy Create free account
hub / github.com/InternRobotics/G2VLM / forward

Method forward

eval_code/recons/models/moge/model/modules.py:233–250  ·  view source on GitHub ↗
(self, in_features: List[torch.Tensor])

Source from the content-addressed store, hash-verified

231 self.res_blocks[i][j] = wrap_module_with_gradient_checkpointing(self.res_blocks[i][j])
232
233 def forward(self, in_features: List[torch.Tensor]):
234 batch_shape = in_features[0].shape[:-3]
235 in_features = [x.reshape(-1, *x.shape[-3:]) for x in in_features]
236
237 out_features = []
238 for i in range(len(self.res_blocks)):
239 feature = self.input_blocks[i](in_features[i])
240 if i == 0:
241 x = feature
242 elif feature is not None:
243 x = x + feature
244 x = self.res_blocks[i](x)
245 out_features.append(self.output_blocks[i](x))
246 if i < len(self.res_blocks) - 1:
247 x = self.resamplers[i](x)
248
249 out_features = [x.unflatten(0, batch_shape) for x in out_features]
250 return out_features

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected