Test code in pytorch 2.4 (#285)

* test code in pytorch 2.4

* update
This commit is contained in:
Sebastian Raschka
2024-07-24 21:53:41 -05:00
committed by GitHub
parent 6cbe6520a2
commit 08040f024c
17 changed files with 509 additions and 377 deletions

View File

@@ -46,7 +46,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"2.2.1\n"
"2.4.0\n"
]
}
],
@@ -658,13 +658,13 @@
"output_type": "stream",
"text": [
"Parameter containing:\n",
"tensor([[ 0.0956, 0.1280, -0.0696, ..., 0.0961, 0.0631, 0.1349],\n",
" [ 0.0983, 0.0580, -0.0574, ..., 0.0981, 0.0370, 0.0516],\n",
" [-0.0429, -0.1411, -0.1399, ..., 0.0767, 0.0019, 0.1400],\n",
"tensor([[ 0.1182, 0.0606, -0.1292, ..., -0.1126, 0.0735, -0.0597],\n",
" [-0.0249, 0.0154, -0.0476, ..., -0.1001, -0.1288, 0.1295],\n",
" [ 0.0641, 0.0018, -0.0367, ..., -0.0990, -0.0424, -0.0043],\n",
" ...,\n",
" [-0.0777, -0.0726, 0.1273, ..., -0.0613, 0.0491, -0.1381],\n",
" [-0.0830, -0.0969, -0.0473, ..., 0.0762, 0.1318, -0.1174],\n",
" [ 0.0468, -0.0213, 0.0387, ..., 0.0639, 0.0927, -0.0668]],\n",
" [ 0.0618, 0.0867, 0.1361, ..., -0.0254, 0.0399, 0.1006],\n",
" [ 0.0842, -0.0512, -0.0960, ..., -0.1091, 0.1242, -0.0428],\n",
" [ 0.0518, -0.1390, -0.0923, ..., -0.0954, -0.0668, -0.0037]],\n",
" requires_grad=True)\n"
]
}
@@ -1264,7 +1264,7 @@
],
"source": [
"model = NeuralNetwork(2, 2) # needs to match the original model exactly\n",
"model.load_state_dict(torch.load(\"model.pth\"))"
"model.load_state_dict(torch.load(\"model.pth\", weights_only=True))"
]
},
{
@@ -1340,7 +1340,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.11"
"version": "3.11.4"
}
},
"nbformat": 4,