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

Method __init__

src/sharp/models/blocks.py:60–64  ·  view source on GitHub ↗

Initialize ResidualBlock.

(self, residual: nn.Module, shortcut: nn.Module | None = None)

Source from the content-addressed store, hash-verified

58 """
59
60 def __init__(self, residual: nn.Module, shortcut: nn.Module | None = None) -> None:
61 """Initialize ResidualBlock."""
62 super().__init__()
63 self.residual = residual
64 self.shortcut = shortcut
65
66 def forward(self, x: torch.Tensor) -> torch.Tensor:
67 """Apply residual block."""

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected