You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
" <img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/>\n",
20
+
"</a>"
21
+
]
22
+
},
23
+
{
24
+
"cell_type": "markdown",
25
+
"metadata": {},
26
+
"source": [
27
+
"This tutorial demonstrates how to use the `pruna` package to optimize any custom computer vision model. We will use the `vit_b_16` model as an example. Any execution times given below are measured on a T4 GPU."
"After the model has been compiled, we run inference for a few iterations as warm-up. This will take around 8 seconds."
124
+
]
125
+
},
126
+
{
127
+
"cell_type": "code",
128
+
"metadata": {},
129
+
"source": [
130
+
"# run some warm-up iterations\n",
131
+
"for _ in range(5):\n",
132
+
" smashed_model(input_tensor)"
133
+
],
134
+
"execution_count": null,
135
+
"outputs": []
136
+
},
137
+
{
138
+
"cell_type": "markdown",
139
+
"metadata": {},
140
+
"source": [
141
+
"Finally, run the model with accelerated inference."
142
+
]
143
+
},
144
+
{
145
+
"cell_type": "code",
146
+
"metadata": {},
147
+
"source": [
148
+
"# Display the result\n",
149
+
"smashed_model(input_tensor)"
150
+
],
151
+
"execution_count": null,
152
+
"outputs": []
153
+
},
154
+
{
155
+
"cell_type": "markdown",
156
+
"metadata": {},
157
+
"source": [
158
+
"### Wrap Up\n",
159
+
"\n",
160
+
"Congratulations! You have successfully smashed a CV model. You can now use the `pruna` package to optimize any custom CV model. The only parts that you should modify are step 1, 4 and 5 to fit your use case"
0 commit comments