def testIssue810(self):

    def loss(A):

        def step(x, i):
            return (jnp.matmul(A, x), None)
        init_x = jnp.zeros(A.shape[(- 1):])
        (last_x, _) = lax.scan(step, init_x, jnp.arange(10))
        return jnp.sum(last_x)
    A = jnp.zeros((3, 3))
    s = str(api.xla_computation(api.grad(loss))(A).as_hlo_text())
    assert (s.count('dynamic-update-slice(') < 2)
def testIssue810(self):

    def loss(A):

        def step(x, i):
            return (jnp.matmul(A, x), None)
        init_x = jnp.zeros(A.shape[(- 1):])
        (last_x, _) = lax.scan(step, init_x, jnp.arange(10))
        return jnp.sum(last_x)
    A = jnp.zeros((3, 3))
    s = str(api.xla_computation(api.grad(loss))(A).as_hlo_text())
    assert (s.count('dynamic-update-slice(') < 2)