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

Method forward

src/sharp/models/normalizers.py:36–38  ·  view source on GitHub ↗

Apply mean and std normalization over input image.

(self, image: torch.Tensor)

Source from the content-addressed store, hash-verified

34 self.register_buffer("std_inv", 1.0 / std)
35
36 def forward(self, image: torch.Tensor) -> torch.Tensor:
37 """Apply mean and std normalization over input image."""
38 return (image - self.mean) * self.std_inv
39
40
41class AffineRangeNormalizer(nn.Module):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected