summaryrefslogtreecommitdiff
path: root/notebooks
diff options
context:
space:
mode:
Diffstat (limited to 'notebooks')
-rw-r--r--notebooks/05c-test-model-end-to-end.ipynb59
1 files changed, 48 insertions, 11 deletions
diff --git a/notebooks/05c-test-model-end-to-end.ipynb b/notebooks/05c-test-model-end-to-end.ipynb
index b26a1fe..42621da 100644
--- a/notebooks/05c-test-model-end-to-end.ipynb
+++ b/notebooks/05c-test-model-end-to-end.ipynb
@@ -2,19 +2,10 @@
"cells": [
{
"cell_type": "code",
- "execution_count": 4,
+ "execution_count": 1,
"id": "1e40a88b",
"metadata": {},
- "outputs": [
- {
- "name": "stdout",
- "output_type": "stream",
- "text": [
- "The autoreload extension is already loaded. To reload it, use:\n",
- " %reload_ext autoreload\n"
- ]
- }
- ],
+ "outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2\n",
@@ -34,6 +25,52 @@
},
{
"cell_type": "code",
+ "execution_count": 2,
+ "id": "f40fc669-829c-4de8-83ed-475fc6a0b8c1",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "class T:\n",
+ " def __init__(self):\n",
+ " self.network = nn.Linear(1, 1)\n",
+ " \n",
+ " def get(self):\n",
+ " return getattr(self, \"network\")"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 3,
+ "id": "d2bedf96-5388-4c7a-a048-1b97041cbedc",
+ "metadata": {},
+ "outputs": [],
+ "source": [
+ "t = T()"
+ ]
+ },
+ {
+ "cell_type": "code",
+ "execution_count": 5,
+ "id": "a6fbe3be-2a9f-4050-a397-7ad982d6cd05",
+ "metadata": {},
+ "outputs": [
+ {
+ "data": {
+ "text/plain": [
+ "<generator object Module.parameters at 0x7f29ad6d6120>"
+ ]
+ },
+ "execution_count": 5,
+ "metadata": {},
+ "output_type": "execute_result"
+ }
+ ],
+ "source": [
+ "t.get().parameters()"
+ ]
+ },
+ {
+ "cell_type": "code",
"execution_count": 5,
"id": "38fb3d9d-a163-4b72-981f-f31b51be39f2",
"metadata": {},