Method
__init__
(
self,
trunk: nn.Module,
neck: nn.Module,
scalp: int = 0,
)
Source from the content-addressed store, hash-verified
| 14 | class ImageEncoder(nn.Module): |
| 15 | |
| 16 | def __init__( |
| 17 | self, |
| 18 | trunk: nn.Module, |
| 19 | neck: nn.Module, |
| 20 | scalp: int = 0, |
| 21 | ): |
| 22 | super().__init__() |
| 23 | self.trunk = trunk |
| 24 | self.neck = neck |
| 25 | self.scalp = scalp |
| 26 | assert ( |
| 27 | self.trunk.channel_list == self.neck.backbone_channel_list |
| 28 | ), f"Channel dims of trunk and neck do not match. Trunk: {self.trunk.channel_list}, neck: {self.neck.backbone_channel_list}" |
| 29 | |
| 30 | def forward(self, sample: torch.Tensor): |
| 31 | # Forward through backbone |
Callers
nothing calls this directly
Tested by
no test coverage detected