Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make minimize jit-able? #4

Open
alibool opened this issue Dec 20, 2021 · 1 comment
Open

make minimize jit-able? #4

alibool opened this issue Dec 20, 2021 · 1 comment

Comments

@alibool
Copy link

alibool commented Dec 20, 2021

Thanks for this great package, it seems thatminimize is not jit-able? for example

from torchmin import minimize
import torch
from functools import partial


def bar(y, x):
    return (x + y).square().sum()

# raise error
@torch.jit.script
def foo(x: torch.Tensor) -> torch.Tensor:
    result = minimize(partial(bar, x=x), torch.tensor([0., 1.]), method='bfgs')
    return result.x

Will you consider making minimize jit-able?

@rfeinman
Copy link
Owner

Hi @alibool - thanks for your comment and suggestion.

This would require a significant refactor. I'd have to step back through each minimization routine, add type hints to the function signatures and make sure that all torch ops are TorchScript-supported. It's on my agenda but it won't be a high priority (unless I have some help).

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

No branches or pull requests

2 participants