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

Method __init__

src/sharp/models/gaussian_decoder.py:96–105  ·  view source on GitHub ↗

Initialize SkipConvBackbone.

(self, dim_in: int, dim_out: int, kernel_size: int, stride_out: int)

Source from the content-addressed store, hash-verified

94 """A wrapper around a conv layer that behaves like a BaseBackbone."""
95
96 def __init__(self, dim_in: int, dim_out: int, kernel_size: int, stride_out: int):
97 """Initialize SkipConvBackbone."""
98 super().__init__()
99 self.stride_out = stride_out
100 if stride_out == 1 and kernel_size != 1:
101 raise ValueError("We only support kernel_size = 1 if stride_out is 1.")
102 padding: int = (kernel_size - 1) // 2
103 self.conv = nn.Conv2d(
104 dim_in, dim_out, kernel_size=kernel_size, stride=stride_out, padding=padding
105 )
106
107 def forward(
108 self,

Callers 1

__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected