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

Method forward

src/sharp/models/normalizers.py:64–72  ·  view source on GitHub ↗

Apply affine range normalization over input image.

(self, x: torch.Tensor)

Source from the content-addressed store, hash-verified

62 self.bias = output_min - input_min * self.scale
63
64 def forward(self, x: torch.Tensor) -> torch.Tensor:
65 """Apply affine range normalization over input image."""
66 if self.scale != 1.0:
67 x = x * self.scale
68
69 if self.bias != 0.0:
70 x = x + self.bias
71
72 return x
73
74
75class MobileNetNormalizer(AffineRangeNormalizer):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected