MCPcopy Create free account
hub / github.com/apple/ml-sharp / forward

Method forward

src/sharp/models/blocks.py:172–184  ·  view source on GitHub ↗

Process and fuse input features.

(self, x0: torch.Tensor, x1: torch.Tensor | None = None)

Source from the content-addressed store, hash-verified

170 self.skip_add = nn.quantized.FloatFunctional()
171
172 def forward(self, x0: torch.Tensor, x1: torch.Tensor | None = None) -> torch.Tensor:
173 """Process and fuse input features."""
174 x = x0
175
176 if x1 is not None:
177 res = self.resnet1(x1)
178 x = self.skip_add.add(x, res)
179
180 x = self.resnet2(x)
181 x = self.deconv(x)
182 x = self.out_conv(x)
183
184 return x
185
186 @staticmethod
187 def _residual_block(num_features: int, batch_norm: bool):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected