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

Method forward

src/sharp/models/blocks.py:66–73  ·  view source on GitHub ↗

Apply residual block.

(self, x: torch.Tensor)

Source from the content-addressed store, hash-verified

64 self.shortcut = shortcut
65
66 def forward(self, x: torch.Tensor) -> torch.Tensor:
67 """Apply residual block."""
68 delta_x = self.residual(x)
69
70 if self.shortcut is not None:
71 x = self.shortcut(x)
72
73 return x + delta_x
74
75
76def residual_block_2d(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected