Skip to content

Commit

Permalink
Update notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas1312 committed Jun 2, 2024
1 parent e3698bf commit afb2292
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ What conditions do diffusion model architectures need to fulfill?
- <https://benanne.github.io/2022/01/31/diffusion.html>
- <https://benanne.github.io/2022/05/26/guidance.html>
- <https://www.chenyang.co/diffusion.html>
- <https://andrewkchan.dev/posts/diffusion.html>
Original file line number Diff line number Diff line change
Expand Up @@ -960,6 +960,14 @@ def my_context_manager():
release_resource(res)
```

Note that with `@contextmanager` your context manager can also be used as a decorator (<https://www.youtube.com/watch?v=_QXlbwRmqgI>, <https://rednafi.com/python/contextmanager/#writing-context-managers-as-decorators>):

```python
@my_context_manager
def my_function():
...
```

It is possible to open multiple contexts at once:

```python
Expand Down

0 comments on commit afb2292

Please sign in to comment.