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

Method __init__

src/sharp/models/encoders/monodepth_encoder.py:65–72  ·  view source on GitHub ↗

Initialize projection module.

(self, dims_in: list[int], dims_out: list[int])

Source from the content-addressed store, hash-verified

63 """Apply projection of features."""
64
65 def __init__(self, dims_in: list[int], dims_out: list[int]) -> None:
66 """Initialize projection module."""
67 super().__init__()
68 if len(dims_in) != len(dims_out):
69 raise ValueError("Length of dims_in must be same as length of dims_out.")
70 self.convs = nn.ModuleList(
71 [nn.Conv2d(dim_in, dim_out, 1) for dim_in, dim_out in zip(dims_in, dims_out)]
72 )
73
74 def forward(self, encodings: list[torch.Tensor]) -> list[torch.Tensor]:
75 """Apply projection module."""

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected