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
chenpangpang
transformers
Commits
4b7988eb
"docs/source/vscode:/vscode.git/clone" did not exist on "c1e139c2b0ea6417b7306b3bff742f59b16f84e7"
Unverified
Commit
4b7988eb
authored
Sep 01, 2021
by
NielsRogge
Committed by
GitHub
Sep 01, 2021
Browse files
Fix assertion (#13369)
parent
c4d78f01
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
src/transformers/models/vit/modeling_vit.py
src/transformers/models/vit/modeling_vit.py
+1
-1
No files found.
src/transformers/models/vit/modeling_vit.py
View file @
4b7988eb
...
...
@@ -103,7 +103,7 @@ class ViTEmbeddings(nn.Module):
mode
=
"bicubic"
,
align_corners
=
False
,
)
assert
int
(
h0
)
==
patch_pos_embed
.
shape
[
-
1
]
and
int
(
w0
)
==
patch_pos_embed
.
shape
[
-
2
]
assert
int
(
h0
)
==
patch_pos_embed
.
shape
[
-
2
]
and
int
(
w0
)
==
patch_pos_embed
.
shape
[
-
1
]
patch_pos_embed
=
patch_pos_embed
.
permute
(
0
,
2
,
3
,
1
).
view
(
1
,
-
1
,
dim
)
return
torch
.
cat
((
class_pos_embed
.
unsqueeze
(
0
),
patch_pos_embed
),
dim
=
1
)
...
...
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