Profile() feature addition

This commit is contained in:
Glenn Jocher 2020-12-11 09:34:27 -08:00
parent ada90e3901
commit bc52ea2d5f
1 changed files with 17 additions and 1 deletions

18
tutorial.ipynb vendored
View File

@ -1188,6 +1188,22 @@
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
"id": "gogI-kwi3Tye"
},
"source": [
"# Profile\n",
"from utils.torch_utils import profile \n",
"\n",
"m1 = lambda x: x * torch.sigmoid(x)\n",
"m2 = torch.nn.SiLU()\n",
"profile(x=torch.randn(16, 3, 640, 640), [m1, m2], n=100)"
],
"execution_count": null,
"outputs": []
},
{
"cell_type": "code",
"metadata": {
@ -1202,4 +1218,4 @@
"outputs": []
}
]
}
}