Skip to content
Merged
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
8 changes: 7 additions & 1 deletion lectures/jax_intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,18 @@ for A in matrices:
print(A)
```

One point to remember is that JAX expects tuples to describe array shapes, even for flat arrays. Hence, to get a one-dimensional array of normal random draws we use `(len, )` for the shape, as in
To get a one-dimensional array of normal random draws, we can either use `(len, )` for the shape, as in

```{code-cell} ipython3
random.normal(key, (5, ))
```

or simply use `5` as the shape argument:

```{code-cell} ipython3
random.normal(key, 5)
```

## JIT compilation

The JAX just-in-time (JIT) compiler accelerates logic within functions by fusing linear
Expand Down
Loading