mirror of
https://github.com/rasbt/LLMs-from-scratch.git
synced 2025-09-26 16:52:04 +00:00
Merge pull request #183 from superkostya/fix-mha-wrapper-class
Fix an incorrect input dimension
This commit is contained in:
commit
f359db8a10
@ -38,7 +38,7 @@
|
|||||||
"name": "stdout",
|
"name": "stdout",
|
||||||
"output_type": "stream",
|
"output_type": "stream",
|
||||||
"text": [
|
"text": [
|
||||||
"torch version: 2.2.1\n"
|
"torch version: 2.2.2\n"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
@ -365,6 +365,14 @@
|
|||||||
"\n",
|
"\n",
|
||||||
"print(\"context_vecs.shape:\", context_vecs.shape)"
|
"print(\"context_vecs.shape:\", context_vecs.shape)"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cell_type": "code",
|
||||||
|
"execution_count": null,
|
||||||
|
"id": "f1d965a5-9b98-4554-8646-7ecd497874cb",
|
||||||
|
"metadata": {},
|
||||||
|
"outputs": [],
|
||||||
|
"source": []
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"metadata": {
|
"metadata": {
|
||||||
|
@ -341,7 +341,7 @@
|
|||||||
" self.d_out = d_out\n",
|
" self.d_out = d_out\n",
|
||||||
"\n",
|
"\n",
|
||||||
" self.qkv = nn.Linear(d_in, 3 * d_out, bias=qkv_bias)\n",
|
" self.qkv = nn.Linear(d_in, 3 * d_out, bias=qkv_bias)\n",
|
||||||
" self.proj = nn.Linear(d_in, d_out)\n",
|
" self.proj = nn.Linear(d_out, d_out)\n",
|
||||||
" self.dropout = dropout\n",
|
" self.dropout = dropout\n",
|
||||||
"\n",
|
"\n",
|
||||||
" def forward(self, x):\n",
|
" def forward(self, x):\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user