microsoft / knossos-ksc

Compiler with automatic differentiation
Other
45 stars 10 forks source link

Add TorchScriptVisitor #964

Closed awf closed 2 years ago

awf commented 2 years ago

Based on #960, reorg TorchScript code into a visitor class, remove global variables, improve recursive function search.

awf commented 2 years ago

@cgravill this should be reviewable even while #960 is being tidied. Should be behaviour-preserving, except that all "call"ed functions are now added to the "todo" list, which enables test_relu to use a local knossos.register.

awf commented 2 years ago

@cgravill ping on this? The diffs are much better if you ignore whitespace changes.

cgravill commented 2 years ago

@cgravill ping on this? The diffs are much better if you ignore whitespace changes.

Sorry, I wanted to give this a more careful look but it contains the global state and all type checks so looks good to me.

dcrc2 commented 2 years ago

Sorry - I merged this without noticing that it needed to be rebased on master. Will create a new PR to fix.