Traceback (most recent call last):


 "/Users/davidanton/develop/issue_vmap/issueVMAP.py", line 18, in <module>

second_derivatives = vmap(vmap_second_derivatives)(variable_positions)


 "/Users/davidanton/develop/issue_vmap/venv/lib/python3.9/site-packages/jax/_src/traceback_util.py", line 139, in reraise_with_filtered_traceback

return fun(*args, **kwargs)


 "/Users/davidanton/develop/issue_vmap/venv/lib/python3.9/site-packages/jax/api.py", line 1237, in batched_fun

out_flat = batching.batch(


 "/Users/davidanton/develop/issue_vmap/venv/lib/python3.9/site-packages/jax/linear_util.py", line 166, in call_wrapped

ans = self.f(*args, **dict(self.params, **kwargs))


 "/Users/davidanton/develop/issue_vmap/issueVMAP.py", line 13, in <lambda>

lambda variable_position: grad(grad(target_function, variable_position), variable_position)(*single_input)


 "/Users/davidanton/develop/issue_vmap/venv/lib/python3.9/site-packages/jax/api.py", line 748, in grad

value_and_grad_f = value_and_grad(fun, argnums, has_aux=has_aux,


 "/Users/davidanton/develop/issue_vmap/venv/lib/python3.9/site-packages/jax/api.py", line 808, in value_and_grad

argnums = _ensure_index(argnums)


 "/Users/davidanton/develop/issue_vmap/venv/lib/python3.9/site-packages/jax/api_util.py", line 38, in _ensure_index

return tuple(map(operator.index, x))


 "/Users/davidanton/develop/issue_vmap/venv/lib/python3.9/site-packages/jax/_src/util.py", line 37, in safe_map

args = list(map(list, args))


 "/Users/davidanton/develop/issue_vmap/venv/lib/python3.9/site-packages/jax/core.py", line 497, in __iter__

return iter(self.aval._iter(self))


 "/Users/davidanton/develop/issue_vmap/venv/lib/python3.9/site-packages/jax/_src/lax/lax.py", line 1943, in _iter

raise TypeError("iteration over a 0-d array")
# same as numpy error
TypeError: iteration over a 0-d array

Traceback (most recent call last):


 "/home/allen/.local/share/virtualenvs/scraper-etbRBiK9/lib/python3.6/site-packages/ruia/spider.py", line 383, in handle_request

callback_result, response = await request.fetch_callback(self.sem)


 "/home/allen/.local/share/virtualenvs/scraper-etbRBiK9/lib/python3.6/site-packages/ruia/request.py", line 159, in fetch_callback

callback_result = await self.callback(response)


 "/mnt/f/workspace/git/scraper/scraper/cnu.py", line 92, in save_image

await f.write(response.html)


 "/home/allen/.local/share/virtualenvs/scraper-etbRBiK9/lib/python3.6/site-packages/aiofiles/threadpool/utils.py", line 36, in method

return (yield from self._loop.run_in_executor(self._executor, cb))


 "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run

result = self.fn(*self.args, **self.kwargs)
TypeError: a bytes-like object is required, not 'str'
