Skip to content

Commit 466ba1e

Browse files
author
liuxinwei
committed
更新文档
1 parent afa87f9 commit 466ba1e

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

doc/tutorials/IRModule.ipynb

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
"# Create a dummy model\n",
9999
"class TorchModel(nn.Module):\n",
100100
" def __init__(self):\n",
101-
" super(TorchModel, self).__init__()\n",
101+
" super().__init__()\n",
102102
" self.fc1 = nn.Linear(784, 256)\n",
103103
" self.relu1 = nn.ReLU()\n",
104104
" self.fc2 = nn.Linear(256, 10)\n",
@@ -175,7 +175,7 @@
175175
"\n",
176176
"class RelaxModel(nn.Module):\n",
177177
" def __init__(self):\n",
178-
" super(RelaxModel, self).__init__()\n",
178+
" super().__init__()\n",
179179
" self.fc1 = nn.Linear(784, 256)\n",
180180
" self.relu1 = nn.ReLU()\n",
181181
" self.fc2 = nn.Linear(256, 10)\n",

doc/tutorials/demo.ipynb

+9-8
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"\n",
6565
"class MLPModel(nn.Module):\n",
6666
" def __init__(self):\n",
67-
" super(MLPModel, self).__init__()\n",
67+
" super().__init__()\n",
6868
" self.fc1 = nn.Linear(784, 256)\n",
6969
" self.relu1 = nn.ReLU()\n",
7070
" self.fc2 = nn.Linear(256, 10)\n",
@@ -121,7 +121,8 @@
121121
}
122122
],
123123
"source": [
124-
"mod, param_spec = MLPModel().export_tvm(\n",
124+
"model = MLPModel()\n",
125+
"mod, param_spec = model.export_tvm(\n",
125126
" spec={\"forward\": {\"x\": nn.spec.Tensor((1, 784), \"float32\")}}\n",
126127
")\n",
127128
"mod.show()"
@@ -147,7 +148,7 @@
147148
},
148149
{
149150
"cell_type": "code",
150-
"execution_count": 4,
151+
"execution_count": 7,
151152
"metadata": {},
152153
"outputs": [],
153154
"source": [
@@ -156,7 +157,7 @@
156157
},
157158
{
158159
"cell_type": "code",
159-
"execution_count": 5,
160+
"execution_count": 8,
160161
"metadata": {},
161162
"outputs": [
162163
{
@@ -273,15 +274,15 @@
273274
},
274275
{
275276
"cell_type": "code",
276-
"execution_count": 6,
277+
"execution_count": 9,
277278
"metadata": {},
278279
"outputs": [
279280
{
280281
"name": "stdout",
281282
"output_type": "stream",
282283
"text": [
283-
"[[24572.564 24926.229 25577.898 24807.32 25382.205 25409.445 24776.041\n",
284-
" 26966.22 25864.61 24976.56 ]]\n"
284+
"[[25814.24 25661.46 23081.768 25914.645 25132.182 26040.564 24963.717\n",
285+
" 25476.984 24674.125 24782.957]]\n"
285286
]
286287
}
287288
],
@@ -350,7 +351,7 @@
350351
"name": "python",
351352
"nbconvert_exporter": "python",
352353
"pygments_lexer": "ipython3",
353-
"version": "3.12.4"
354+
"version": "3.12.2"
354355
}
355356
},
356357
"nbformat": 4,

0 commit comments

Comments
 (0)