Unverified Commit 753bf186 authored by YosuaMichael's avatar YosuaMichael Committed by GitHub
Browse files

[FBcode->GH] Fix vit model assert message to be compatible with torchmultimodal test (#6592)

parent 6945201d
...@@ -268,8 +268,8 @@ class VisionTransformer(nn.Module): ...@@ -268,8 +268,8 @@ class VisionTransformer(nn.Module):
def _process_input(self, x: torch.Tensor) -> torch.Tensor: def _process_input(self, x: torch.Tensor) -> torch.Tensor:
n, c, h, w = x.shape n, c, h, w = x.shape
p = self.patch_size p = self.patch_size
torch._assert(h == self.image_size, f"Wrong image height, expected {self.image_size} but got {h}!") torch._assert(h == self.image_size, f"Wrong image height! Expected {self.image_size} but got {h}!")
torch._assert(w == self.image_size, f"Wrong image width, expected {self.image_size} but got {w}!") torch._assert(w == self.image_size, f"Wrong image width! Expected {self.image_size} but got {w}!")
n_h = h // p n_h = h // p
n_w = w // p n_w = w // p
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment