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

Method forward

src/sharp/models/encoders/unet_encoder.py:94–112  ·  view source on GitHub ↗

Apply UNet Encoder to image. Args: input: The input image. Returns: The output multi-level feature map from encoder.

(self, input: torch.Tensor)

Source from the content-addressed store, hash-verified

92 self.convs_down.append(convs_down_i)
93
94 def forward(self, input: torch.Tensor) -> list[torch.Tensor]:
95 """Apply UNet Encoder to image.
96
97 Args:
98 input: The input image.
99
100 Returns:
101 The output multi-level feature map from encoder.
102 """
103 features = []
104
105 feat_i = self.conv_in(input)
106 features.append(feat_i)
107
108 for conv_down in self.convs_down:
109 feat_i = conv_down(feat_i)
110 features.append(feat_i)
111
112 return features
113
114 @property
115 def out_width(self) -> int:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected