Skip to content

Fixes a TypeError in rosenbrock_ademamix.ipynb caused by a parameter name mismatch. - #1741

Open
rajasekharporeddy wants to merge 1 commit into
google-deepmind:mainfrom
rajasekharporeddy:rosenbrock
Open

Fixes a TypeError in rosenbrock_ademamix.ipynb caused by a parameter name mismatch.#1741
rajasekharporeddy wants to merge 1 commit into
google-deepmind:mainfrom
rajasekharporeddy:rosenbrock

Conversation

@rajasekharporeddy

Copy link
Copy Markdown
Collaborator

The function _body_fn expects the keyword argument solver, but was being called with solve. This PR renames the argument in the function call to solver to resolve the issue.

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
/tmp/ipykernel_2781/1762145155.py in <cell line: 0>()
     20     opt_state = solver.init(params)
     21 
---> 22     _, all_params = jax.lax.scan(
     23         partial(_body_fn, solve=solver, b1=b1),
     24         (params, opt_state, 0),

    [... skipping hidden 9 frame]

/usr/local/lib/python3.12/dist-packages/jax/_src/linear_util.py in _get_result_paths_thunk(_fun, _store, *args, **kwargs)
    427 @transformation_with_aux2
    428 def _get_result_paths_thunk(_fun: Callable, _store: Store, *args, **kwargs):
--> 429   ans = _fun(*args, **kwargs)
    430   result_paths = tuple(f"result{_clean_keystr_arg_names(path)}" for path, _ in generate_key_paths(ans))
    431   if _store:

TypeError: _body_fn() got an unexpected keyword argument 'solve'

Failure repro: Colab gist

Fixed Notebook: Colab gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant