Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
753bf186
Unverified
Commit
753bf186
authored
Sep 16, 2022
by
YosuaMichael
Committed by
GitHub
Sep 16, 2022
Browse files
[FBcode->GH] Fix vit model assert message to be compatible with torchmultimodal test (#6592)
parent
6945201d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
torchvision/models/vision_transformer.py
torchvision/models/vision_transformer.py
+2
-2
No files found.
torchvision/models/vision_transformer.py
View file @
753bf186
...
@@ -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
, e
xpected
{
self
.
image_size
}
but got
{
h
}
!"
)
torch
.
_assert
(
h
==
self
.
image_size
,
f
"Wrong image height
! E
xpected
{
self
.
image_size
}
but got
{
h
}
!"
)
torch
.
_assert
(
w
==
self
.
image_size
,
f
"Wrong image width
, e
xpected
{
self
.
image_size
}
but got
{
w
}
!"
)
torch
.
_assert
(
w
==
self
.
image_size
,
f
"Wrong image width
! E
xpected
{
self
.
image_size
}
but got
{
w
}
!"
)
n_h
=
h
//
p
n_h
=
h
//
p
n_w
=
w
//
p
n_w
=
w
//
p
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment