Removed unnecessary self.projection call in VivitTubeletEmbeddings (#31632)

removes unnecessary second projection call
This commit is contained in:
Vladimir Iashin 2024-06-26 11:19:26 +01:00 committed by GitHub
parent 2daf2c3eaa
commit 1218e439b5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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