Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

purpose behind code change #4

Open
GeorgeBrowncb opened this issue Sep 28, 2024 · 0 comments
Open

purpose behind code change #4

GeorgeBrowncb opened this issue Sep 28, 2024 · 0 comments

Comments

@GeorgeBrowncb
Copy link

Hi! Thank you for your code!

I noticed that this repo is heavily based on DualPrompt (https://github.com/JH-LEE-KR/dualprompt-pytorch).

At the same time, I found in JH-LEE-KR/dualprompt-pytorch#8 that there is an error in tensor operations.

After reading your code, I noticed that you modified this part differently from the original repo. Could you explain the purpose behind this change?

ConvPrompt/prompt.py

Lines 257 to 263 in 73ed205

batched_prompt_raw = self.prompt[layer_num].unsqueeze(0).repeat(x_embed.shape[0], 1, 1) # B, length, C
dual = 2
batch_size, length, embed_dim = batched_prompt_raw.shape
# print("Batched Prompt Shape = ", batched_prompt_raw.shape)
batched_prompt = batched_prompt_raw.reshape(
batch_size, dual, length // dual, self.num_heads, embed_dim // self.num_heads
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant