pierrickpochelu / jaxdecompiler Goto Github PK
View Code? Open in Web Editor NEWJax Decompiler
License: Apache License 2.0
Jax Decompiler
License: Apache License 2.0
Hello and congrats on starting this interesting project! I encountered this bug while running the following code:
import jax.numpy as jnp
from jax import value_and_grad
import decompiler
def fun(ra, rb, r0, k):
rab = ra - rb
rab = jnp.sqrt(jnp.dot(rab, rab))
return 0.5 * k * (rab - r0) ** 2
df = value_and_grad(fun)
ra = jnp.ones(3)
rb = 2 * ra
decomp, pycode = decompiler.python_jaxpr_python(df, (ra, rb, 0.5, 20.0), is_python_returned=True)
print(pycode)
Traceback (most recent call last):
File "JaxDecompiler/my_test.py", line 13, in <module>
decomp, pycode = decompiler.python_jaxpr_python(df, (ra, rb, r0, k, box), is_python_returned=True)
File "JaxDecompiler/decompiler.py", line 35, in python_jaxpr_python
out = from_jaxpr_object_to_python(jaxpr_obj, **kwargs)
File "JaxDecompiler/decompiler.py", line 22, in from_jaxpr_object_to_python
return f, (os.linesep).join(python_lines)
TypeError: sequence item 3: expected str instance, list found
I guess a simple fix is to replace
Line 184 in be3a275
tabbed_python_lines.extend(list_of_python_lines)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.