Sharp Bits: fix formatting of code blocks within list

This commit is contained in:
Jake VanderPlas 2021-03-15 16:50:07 -07:00
parent 3b7de31c36
commit 4d8e9540a4
2 changed files with 30 additions and 30 deletions

View File

@ -1640,27 +1640,27 @@
"\n",
"2. You can manually set the `jax_enable_x64` configuration flag at startup:\n",
"\n",
"```\n",
"# again, this only works on startup!\n",
"from jax.config import config\n",
"config.update(\"jax_enable_x64\", True)\n",
"```\n",
" ```python\n",
" # again, this only works on startup!\n",
" from jax.config import config\n",
" config.update(\"jax_enable_x64\", True)\n",
" ```\n",
"\n",
"3. You can parse command-line flags with `absl.app.run(main)`\n",
"\n",
"```\n",
"from jax.config import config\n",
"config.config_with_absl()\n",
"```\n",
" ```python\n",
" from jax.config import config\n",
" config.config_with_absl()\n",
" ```\n",
"\n",
"4. If you want JAX to run absl parsing for you, i.e. you don't want to do `absl.app.run(main)`, you can instead use\n",
"\n",
"```\n",
"from jax.config import config\n",
"if __name__ == '__main__':\n",
" # calls config.config_with_absl() *and* runs absl parsing\n",
" config.parse_flags_with_absl()\n",
"```\n",
" ```python\n",
" from jax.config import config\n",
" if __name__ == '__main__':\n",
" # calls config.config_with_absl() *and* runs absl parsing\n",
" config.parse_flags_with_absl()\n",
" ```\n",
"\n",
"Note that #2-#4 work for _any_ of JAX's configuration options.\n",
"\n",

View File

@ -922,27 +922,27 @@ There are a few ways to do this:
2. You can manually set the `jax_enable_x64` configuration flag at startup:
```
# again, this only works on startup!
from jax.config import config
config.update("jax_enable_x64", True)
```
```python
# again, this only works on startup!
from jax.config import config
config.update("jax_enable_x64", True)
```
3. You can parse command-line flags with `absl.app.run(main)`
```
from jax.config import config
config.config_with_absl()
```
```python
from jax.config import config
config.config_with_absl()
```
4. If you want JAX to run absl parsing for you, i.e. you don't want to do `absl.app.run(main)`, you can instead use
```
from jax.config import config
if __name__ == '__main__':
# calls config.config_with_absl() *and* runs absl parsing
config.parse_flags_with_absl()
```
```python
from jax.config import config
if __name__ == '__main__':
# calls config.config_with_absl() *and* runs absl parsing
config.parse_flags_with_absl()
```
Note that #2-#4 work for _any_ of JAX's configuration options.