diff --git a/notebooks/internals/0_custom_analysis_pass.ipynb b/notebooks/advanced/0_custom_analysis_pass.ipynb similarity index 90% rename from notebooks/internals/0_custom_analysis_pass.ipynb rename to notebooks/advanced/0_custom_analysis_pass.ipynb index ce95f1297ff92cf8c19287ef4d564ba40e0ba6b1..4be8e59284a8f53b7c467c19e24835721b29c277 100644 --- a/notebooks/internals/0_custom_analysis_pass.ipynb +++ b/notebooks/advanced/0_custom_analysis_pass.ipynb @@ -17,10 +17,7 @@ "metadata": {}, "outputs": [], "source": [ - "import inspect\n", - "\n", - "def showSrc(what):\n", - " print(\"\".join(inspect.getsourcelines(what)[0]))" + "from finn.util.visualization import showSrc, showInNetron" ] }, { @@ -53,19 +50,6 @@ "cell_type": "code", "execution_count": 2, "metadata": {}, - "outputs": [], - "source": [ - "import netron\n", - "from IPython.display import IFrame\n", - "def showInNetron(model_filename):\n", - " netron.start(model_filename, port=8081, host=\"0.0.0.0\")\n", - " return IFrame(src=\"http://0.0.0.0:8081/\", width=\"100%\", height=400)" - ] - }, - { - "cell_type": "code", - "execution_count": 3, - "metadata": {}, "outputs": [ { "name": "stdout", @@ -88,10 +72,10 @@ " " ], "text/plain": [ - "<IPython.lib.display.IFrame at 0x7f34317f1278>" + "<IPython.lib.display.IFrame at 0x7ff8c03ac438>" ] }, - "execution_count": 3, + "execution_count": 2, "metadata": {}, "output_type": "execute_result" } @@ -109,7 +93,7 @@ }, { "cell_type": "code", - "execution_count": 4, + "execution_count": 3, "metadata": {}, "outputs": [], "source": [ @@ -126,7 +110,7 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "metadata": {}, "outputs": [], "source": [ @@ -156,7 +140,7 @@ }, { "cell_type": "code", - "execution_count": 6, + "execution_count": 5, "metadata": {}, "outputs": [ { @@ -183,7 +167,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [ { diff --git a/notebooks/internals/1_custom_transformation_pass.ipynb b/notebooks/advanced/1_custom_transformation_pass.ipynb similarity index 93% rename from notebooks/internals/1_custom_transformation_pass.ipynb rename to notebooks/advanced/1_custom_transformation_pass.ipynb index 8e19bc7a090815a028bdd4ac1b971d0cc62f085c..d6d78270bbd3d29ca865077c851df8f709cd8baa 100644 --- a/notebooks/internals/1_custom_transformation_pass.ipynb +++ b/notebooks/advanced/1_custom_transformation_pass.ipynb @@ -17,10 +17,7 @@ "metadata": {}, "outputs": [], "source": [ - "import inspect\n", - "\n", - "def showSrc(what):\n", - " print(\"\".join(inspect.getsourcelines(what)[0]))" + "from finn.util.visualization import showSrc, showInNetron" ] }, { @@ -163,19 +160,6 @@ "cell_type": "code", "execution_count": 5, "metadata": {}, - "outputs": [], - "source": [ - "import netron\n", - "from IPython.display import IFrame\n", - "def showInNetron(model_filename):\n", - " netron.start(model_filename, port=8081, host=\"0.0.0.0\")\n", - " return IFrame(src=\"http://0.0.0.0:8081/\", width=\"100%\", height=400)" - ] - }, - { - "cell_type": "code", - "execution_count": 6, - "metadata": {}, "outputs": [ { "name": "stdout", @@ -198,10 +182,10 @@ " " ], "text/plain": [ - "<IPython.lib.display.IFrame at 0x7f57cafc5c88>" + "<IPython.lib.display.IFrame at 0x7f9a1e9fcac8>" ] }, - "execution_count": 6, + "execution_count": 5, "metadata": {}, "output_type": "execute_result" } @@ -212,7 +196,7 @@ }, { "cell_type": "code", - "execution_count": 7, + "execution_count": 6, "metadata": {}, "outputs": [], "source": [ @@ -249,7 +233,7 @@ }, { "cell_type": "code", - "execution_count": 8, + "execution_count": 7, "metadata": {}, "outputs": [], "source": [ @@ -259,7 +243,7 @@ }, { "cell_type": "code", - "execution_count": 10, + "execution_count": 8, "metadata": {}, "outputs": [ { @@ -285,10 +269,10 @@ " " ], "text/plain": [ - "<IPython.lib.display.IFrame at 0x7f57e15781d0>" + "<IPython.lib.display.IFrame at 0x7f9a34fff3c8>" ] }, - "execution_count": 10, + "execution_count": 8, "metadata": {}, "output_type": "execute_result" } diff --git a/notebooks/internals/im2col_finnhlslib.PNG b/notebooks/advanced/im2col_finnhlslib.PNG similarity index 100% rename from notebooks/internals/im2col_finnhlslib.PNG rename to notebooks/advanced/im2col_finnhlslib.PNG