Skip to content

Commit 11a6976

Browse files
author
learned_optimization authors
committed
No public description
PiperOrigin-RevId: 619147712
1 parent 4bcaeb0 commit 11a6976

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

docs/notebooks/summary_tutorial.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@
353353
"source": [
354354
"Then we can transform the `loss` function with the function transformation: `summary.with_summary_output_reduced`.\n",
355355
"This transformation goes through the computation and extracts all the tagged values and returns them to us by name in a dictionary.\n",
356-
"In implementation, all the hard work here is done by the wonderful `oryx` library (in particular [harvest](https://github.com/tensorflow/probability/blob/main/spinoffs/oryx/oryx/core/interpreters/harvest.py)).\n",
356+
"In implementation, all the hard work here is done by the wonderful `oryx` library (in particular [harvest](https://github.com/jax-ml/oryx/tree/main/oryx/core/interpreters/harvest.py)).\n",
357357
"When we wrap a function this, we return a tuple containing the original result, and a dictionary with the desired metrics."
358358
]
359359
},
@@ -893,7 +893,7 @@
893893
"source": [
894894
"def monitor(a):\n",
895895
" summary.summary(\"with_input\", a)\n",
896-
" summary.summary(\"constant\", 2.0)\n",
896+
" summary.summary(\"constant\", jnp.asarray(2.0))\n",
897897
" summary.summary(\"constant_with_inp\", 2.0 + (a * 0))\n",
898898
" return a\n",
899899
"\n",

docs/notebooks/summary_tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ def loss(parameters):
112112

113113
Then we can transform the `loss` function with the function transformation: `summary.with_summary_output_reduced`.
114114
This transformation goes through the computation and extracts all the tagged values and returns them to us by name in a dictionary.
115-
In implementation, all the hard work here is done by the wonderful `oryx` library (in particular [harvest](https://github.com/tensorflow/probability/blob/main/spinoffs/oryx/oryx/core/interpreters/harvest.py)).
115+
In implementation, all the hard work here is done by the wonderful `oryx` library (in particular [harvest](https://github.com/jax-ml/oryx/tree/main/oryx/core/interpreters/harvest.py)).
116116
When we wrap a function this, we return a tuple containing the original result, and a dictionary with the desired metrics.
117117

118118
```{code-cell}
@@ -399,7 +399,7 @@ outputId: b1ccd1db-5615-45b9-b52c-0ae78ea9369f
399399
---
400400
def monitor(a):
401401
summary.summary("with_input", a)
402-
summary.summary("constant", 2.0)
402+
summary.summary("constant", jnp.asarray(2.0))
403403
summary.summary("constant_with_inp", 2.0 + (a * 0))
404404
return a
405405

docs/notebooks/summary_tutorial.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
# kernelspec:
2626
# display_name: Python 3
2727
# name: python3
28+
# pylint: disable=line-too-long
2829
# ---
2930

3031
# + [markdown] id="ryqPvTKI19zH"
@@ -99,7 +100,7 @@ def loss(parameters):
99100
# + [markdown] id="AL9_xgfR4yPS"
100101
# Then we can transform the `loss` function with the function transformation: `summary.with_summary_output_reduced`.
101102
# This transformation goes through the computation and extracts all the tagged values and returns them to us by name in a dictionary.
102-
# In implementation, all the hard work here is done by the wonderful `oryx` library (in particular [harvest](https://github.com/tensorflow/probability/blob/main/spinoffs/oryx/oryx/core/interpreters/harvest.py)).
103+
# In implementation, all the hard work here is done by the wonderful `oryx` library (in particular [harvest](https://github.com/jax-ml/oryx/tree/main/oryx/core/interpreters/harvest.py)).
103104
# When we wrap a function this, we return a tuple containing the original result, and a dictionary with the desired metrics.
104105

105106
# + colab={"base_uri": "https://localhost:8080/"} id="hZQkB6Um8PI5" outputId="984e4f64-7562-48ae-ca68-ff4014037553"
@@ -299,7 +300,7 @@ def loss(parameters):
299300
# + colab={"base_uri": "https://localhost:8080/"} id="iIbrjrJ4HEd-" outputId="b1ccd1db-5615-45b9-b52c-0ae78ea9369f"
300301
def monitor(a):
301302
summary.summary("with_input", a)
302-
summary.summary("constant", 2.0)
303+
summary.summary("constant", jnp.asarray(2.0))
303304
summary.summary("constant_with_inp", 2.0 + (a * 0))
304305
return a
305306

0 commit comments

Comments
 (0)