Skip to content

Commit ba2fd64

Browse files
committed
fix bug
1 parent 868fb41 commit ba2fd64

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lectures/ge_arrow.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -998,12 +998,11 @@ def compute_rc_model(s, P, ys, s0_idx=0, γ=0.5, β=0.98, T=0):
998998
diff = jnp.empty((n, K))
999999
10001000
# Loop scatters each agent's state-dependent surplus into the column k.
1001-
def body(k, carry):
1002-
diff = carry
1001+
def body(k, diff):
10031002
return diff.at[:, k].set(α[k] * y - ys[:, k])
10041003
10051004
# Applies body sequentially while threading diff.
1006-
diff = jax.lax.scan(0, K, body, diff)
1005+
diff = jax.lax.fori_loop(0, K, body, diff)
10071006
10081007
ψ = V @ diff
10091008

0 commit comments

Comments
 (0)