Fix run_clip.py (#20234)

Co-authored-by: ydshieh <ydshieh@users.noreply.github.com>
This commit is contained in:
Yih-Dar
2022-11-15 15:45:21 +01:00
committed by GitHub
parent 683cbc4c34
commit cf7b98b807

View File

@@ -198,7 +198,8 @@ class Transform(torch.nn.Module):
Normalize(mean, std),
)
def forward(self, x: Image) -> torch.Tensor:
def forward(self, x) -> torch.Tensor:
"""`x` should be an instance of `PIL.Image.Image`"""
with torch.no_grad():
x = self.transforms(x)
return x