Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
1218e439
Unverified
Commit
1218e439
authored
Jun 26, 2024
by
Vladimir Iashin
Committed by
GitHub
Jun 26, 2024
Browse files
Removed unnecessary `self.projection` call in `VivitTubeletEmbeddings` (#31632)
removes unnecessary second projection call
parent
2daf2c3e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
src/transformers/models/vivit/modeling_vivit.py
src/transformers/models/vivit/modeling_vivit.py
+2
-1
No files found.
src/transformers/models/vivit/modeling_vivit.py
View file @
1218e439
...
...
@@ -76,7 +76,8 @@ class VivitTubeletEmbeddings(nn.Module):
x
=
self
.
projection
(
pixel_values
)
# out_batch_size, out_num_channels, out_num_frames, out_height, out_width = x.shape
x
=
self
.
projection
(
pixel_values
).
flatten
(
2
).
transpose
(
1
,
2
)
# flattens time and space dimensions, transposes to (out_batch_size, flat_tokens, out_num_channels)
x
=
x
.
flatten
(
2
).
transpose
(
1
,
2
)
return
x
...
...
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