| 28 | |
| 29 | |
| 30 | class Mapping(nn.Module, ABC, Generic[T]): |
| 31 | def __init__(self, cfg: T) -> None: |
| 32 | super().__init__() |
| 33 | self.cfg = cfg |
| 34 | |
| 35 | def forward( |
| 36 | self, |
| 37 | a: Float[Tensor, "*#batch 2"], |
| 38 | b: Float[Tensor, "*#batch 2"], |
| 39 | image_shape: tuple[int, int], |
| 40 | ) -> Float[Tensor, " *batch"]: |
| 41 | a = fix_aspect_ratio(a, image_shape) |
| 42 | b = fix_aspect_ratio(b, image_shape) |
| 43 | return self.forward_undistorted(a - b) |
| 44 | |
| 45 | @abstractmethod |
| 46 | def forward_undistorted( |
| 47 | self, |
| 48 | delta: Float[Tensor, "*batch 2"], |
| 49 | ) -> Float[Tensor, " *batch"]: |
| 50 | pass |
nothing calls this directly
no outgoing calls
no test coverage detected