🐛 Bug
torch.lu can be traced, but script compilation raises Unknown builtin op: aten::lu error.
To Reproduce
def f(A, b):
return torch.lu_solve(b, *torch.lu(A))
A = torch.eye(3)
b = torch.ones((3, 1))
torch.jit.trace(f, (A, b)) # <-- OK
torch.jit.script(f) # <-- Unknown builtin op: aten::lu
Using torch.solve or torch.cholsky+torch.cholesky_solve works fine.
Workaround
Trace torch.lu and then call it from the script:
lu_trace = torch.jit.trace(torch.lu, torch.eye(2))
@torch.jit.script
def f(A, b):
return torch.lu_solve(b, *lu_trace(A)) # <-- OK
Environment
- PyTorch 1.4.0
- MacOS
- conda install
- Python 3.7.6
- CPU only
cc @suo
🐛 Bug
torch.lucan be traced, but script compilation raisesUnknown builtin op: aten::luerror.To Reproduce
Using
torch.solveortorch.cholsky+torch.cholesky_solveworks fine.Workaround
Trace
torch.luand then call it from the script:Environment
cc @suo