MCPcopy Create free account
hub / github.com/ImprintLab/Medical-SAM2 / __init__

Method __init__

sam2_train/modeling/memory_encoder.py:121–128  ·  view source on GitHub ↗
(self, layer, num_layers, dim=None, input_projection=False)

Source from the content-addressed store, hash-verified

119
120class Fuser(nn.Module):
121 def __init__(self, layer, num_layers, dim=None, input_projection=False):
122 super().__init__()
123 self.proj = nn.Identity()
124 self.layers = get_clones(layer, num_layers)
125
126 if input_projection:
127 assert dim is not None
128 self.proj = nn.Conv2d(dim, dim, kernel_size=1)
129
130 def forward(self, x):
131 # normally x: (N, C, H, W)

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

get_clonesFunction · 0.90

Tested by

no test coverage detected