Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 18 additions & 84 deletions fiddle/examples/colabs/auto_config.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,8 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 2144,
"status": "ok",
"timestamp": 1641863254222,
"user": {
"displayName": "",
"photoUrl": "",
"userId": ""
},
"user_tz": 480
},
"id": "33zel0HX-u0M"
},
"outputs": [],
Expand All @@ -60,19 +49,8 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 176,
"status": "ok",
"timestamp": 1641863254532,
"user": {
"displayName": "",
"photoUrl": "",
"userId": ""
},
"user_tz": 480
},
"id": "u33H6p-n-fce"
},
"outputs": [],
Expand All @@ -84,19 +62,8 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 57,
"status": "ok",
"timestamp": 1641863254720,
"user": {
"displayName": "",
"photoUrl": "",
"userId": ""
},
"user_tz": 480
},
"id": "7sxFxIlNLTM8"
},
"outputs": [],
Expand All @@ -115,7 +82,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 57,
Expand Down Expand Up @@ -191,19 +158,8 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 59,
"status": "ok",
"timestamp": 1641863255131,
"user": {
"displayName": "",
"photoUrl": "",
"userId": ""
},
"user_tz": 480
},
"id": "s_1UkCZq92eL"
},
"outputs": [],
Expand All @@ -228,7 +184,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"metadata": {
"colab": {
"height": 257
Expand Down Expand Up @@ -277,7 +233,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 3,
Expand Down Expand Up @@ -342,7 +298,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 6,
Expand Down Expand Up @@ -408,7 +364,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": null,
"metadata": {
"colab": {
"height": 232
Expand Down Expand Up @@ -466,7 +422,7 @@
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": null,
"metadata": {
"colab": {
"height": 257
Expand Down Expand Up @@ -525,7 +481,7 @@
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": null,
"metadata": {
"colab": {
"height": 232
Expand Down Expand Up @@ -574,7 +530,7 @@
},
{
"cell_type": "code",
"execution_count": 12,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 55,
Expand Down Expand Up @@ -673,7 +629,7 @@
"\n",
"* **Functions cannot contain any control flow**. At the moment this a restriction intended to encourage simplicity and predictability in functions that use auto-config, since some natural constructs (like using `itertools` functions in loop definitions) could have unexpected results. We are exploring ways to support simple control flow constructs like `for` loops more robustly.\n",
"\n",
"* **Code that relies on object instances, properties, or methods**. During execution of an auto-configured function, object creation calls are transformed into \"unevaluated\" `fdl.Config` instances. As a result, object instances (and hence their properties and methods) will not be available for subsequent code during execution of the function. A workaround is to use additional helper functions, as documented in the [intro colab](fiddle_tutorial_with_flax.ipynb) section on the computed value pattern.\n",
"* **Code that relies on object instances, properties, or methods**. During execution of an auto-configured function, any created `fdl.Config` instances are wrapped in temporary proxy objects that disallow attribute and item access (before being unwrapped into `fdl.Config` instances at the end). As a result, object instances (and hence their properties and methods) will not be available for subsequent code during execution of the function. A workaround is to use additional helper functions, as documented in the [intro colab](fiddle_tutorial_with_flax.ipynb) section on the computed value pattern.\n",
"\n",
"* **Functions that return tuples or lists**. If a function returns a sequence, and only some elements of the sequence must be passed to subsequent functions, automatic \"destructuring\" of the return value isn't supported. A workaround is accessing the required elements or slices via lambdas, e.g. `(lambda t: t[0])(sequence_output)`.\n",
"\n",
Expand Down Expand Up @@ -719,19 +675,8 @@
},
{
"cell_type": "code",
"execution_count": 13,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 267,
"status": "ok",
"timestamp": 1641863272383,
"user": {
"displayName": "",
"photoUrl": "",
"userId": ""
},
"user_tz": 480
},
"id": "e9OKzSfkSSce"
},
"outputs": [],
Expand Down Expand Up @@ -795,19 +740,8 @@
},
{
"cell_type": "code",
"execution_count": 14,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 54,
"status": "ok",
"timestamp": 1641863272577,
"user": {
"displayName": "",
"photoUrl": "",
"userId": ""
},
"user_tz": 480
},
"id": "jH5L0M-haNYJ"
},
"outputs": [],
Expand Down Expand Up @@ -860,7 +794,7 @@
},
{
"cell_type": "code",
"execution_count": 15,
"execution_count": null,
"metadata": {
"colab": {
"height": 457
Expand Down Expand Up @@ -908,7 +842,7 @@
},
{
"cell_type": "code",
"execution_count": 16,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 6472,
Expand Down Expand Up @@ -984,7 +918,7 @@
},
{
"cell_type": "code",
"execution_count": 17,
"execution_count": null,
"metadata": {
"executionInfo": {
"elapsed": 3401,
Expand Down
Loading