dim-consistency

This commit is contained in:
rasbt 2024-06-12 19:43:25 -05:00
parent 8d3e58ff81
commit 8fa64806fc

View File

@ -1369,7 +1369,7 @@
} }
], ],
"source": [ "source": [
"row_sums = masked_simple.sum(dim=1, keepdim=True)\n", "row_sums = masked_simple.sum(dim=-1, keepdim=True)\n",
"masked_simple_norm = masked_simple / row_sums\n", "masked_simple_norm = masked_simple / row_sums\n",
"print(masked_simple_norm)" "print(masked_simple_norm)"
] ]
@ -2027,7 +2027,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.10.6" "version": "3.11.4"
} }
}, },
"nbformat": 4, "nbformat": 4,