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

Class BaseEncoder

src/sharp/models/encoders/base_encoder.py:13–25  ·  view source on GitHub ↗

Base encoder class.

Source from the content-addressed store, hash-verified

11
12
13class BaseEncoder(nn.Module, abc.ABC):
14 """Base encoder class."""
15
16 dim_in: int
17 output_dims: list[int]
18
19 @abc.abstractmethod
20 def forward(self, image: torch.Tensor) -> list[torch.Tensor]:
21 """Encode input image into multi-resolution encodings."""
22
23 def internal_resolution(self) -> int:
24 """Internal resolution of the encoder."""
25 return 1536

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected