Commit
·
bc52ea2
1
Parent(s):
ada90e3
Profile() feature addition
Browse files- tutorial.ipynb +17 -1
tutorial.ipynb
CHANGED
@@ -1188,6 +1188,22 @@
|
|
1188 |
"execution_count": null,
|
1189 |
"outputs": []
|
1190 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1191 |
{
|
1192 |
"cell_type": "code",
|
1193 |
"metadata": {
|
@@ -1202,4 +1218,4 @@
|
|
1202 |
"outputs": []
|
1203 |
}
|
1204 |
]
|
1205 |
-
}
|
|
|
1188 |
"execution_count": null,
|
1189 |
"outputs": []
|
1190 |
},
|
1191 |
+
{
|
1192 |
+
"cell_type": "code",
|
1193 |
+
"metadata": {
|
1194 |
+
"id": "gogI-kwi3Tye"
|
1195 |
+
},
|
1196 |
+
"source": [
|
1197 |
+
"# Profile\n",
|
1198 |
+
"from utils.torch_utils import profile \n",
|
1199 |
+
"\n",
|
1200 |
+
"m1 = lambda x: x * torch.sigmoid(x)\n",
|
1201 |
+
"m2 = torch.nn.SiLU()\n",
|
1202 |
+
"profile(x=torch.randn(16, 3, 640, 640), [m1, m2], n=100)"
|
1203 |
+
],
|
1204 |
+
"execution_count": null,
|
1205 |
+
"outputs": []
|
1206 |
+
},
|
1207 |
{
|
1208 |
"cell_type": "code",
|
1209 |
"metadata": {
|
|
|
1218 |
"outputs": []
|
1219 |
}
|
1220 |
]
|
1221 |
+
}
|