Skip to content

Commit 40fa336

Browse files
jstacclaude
andcommitted
Remove unnecessary @jax.jit decorators from intermediate functions
Only kept @jax.jit on top-level user-facing functions (solve_model and compute_reservation_wage). Removed it from intermediate functions (u, compute_v_e, update_d) since they are automatically compiled when called from jitted functions. Benefits: - Cleaner code with less decorator clutter - Avoids redundant compilation overhead - Follows JAX best practices of jitting at the top level 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 269eb49 commit 40fa336

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

lectures/mccall_model_with_separation.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ This helps to tidy up the code and provides an object that's easy to pass to fun
319319
The default utility function is a CRRA utility function
320320

321321
```{code-cell} ipython3
322-
@jax.jit
323322
def u(c, σ=2.0):
324323
return (c**(1 - σ) - 1) / (1 - σ)
325324
```
@@ -353,7 +352,6 @@ We then return the current iterate as an approximate solution.
353352
First, we define a function to compute $v_e$ from $d$:
354353

355354
```{code-cell} ipython3
356-
@jax.jit
357355
def compute_v_e(model, d):
358356
" Compute v_e from d using the closed-form expression. "
359357
α, β, w = model.α, model.β, model.w
@@ -363,7 +361,6 @@ def compute_v_e(model, d):
363361
Now we implement the iteration on $d$ only:
364362

365363
```{code-cell} ipython3
366-
@jax.jit
367364
def update_d(model, d):
368365
" One update of the scalar d. "
369366
α, β, c, w, q = model.α, model.β, model.c, model.w, model.q

0 commit comments

Comments
 (0)