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
321f6552
Unverified
Commit
321f6552
authored
Sep 14, 2022
by
YosuaMichael
Committed by
GitHub
Sep 14, 2022
Browse files
Make the assert message more verbose (#6583)
parent
24890d71
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 @
321f6552
...
...
@@ -268,8 +268,8 @@ class VisionTransformer(nn.Module):
def
_process_input
(
self
,
x
:
torch
.
Tensor
)
->
torch
.
Tensor
:
n
,
c
,
h
,
w
=
x
.
shape
p
=
self
.
patch_size
torch
.
_assert
(
h
==
self
.
image_size
,
"Wrong image height!"
)
torch
.
_assert
(
w
==
self
.
image_size
,
"Wrong image width!"
)
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
}
!"
)
n_h
=
h
//
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