Automatically broadcast scalar functions to arbitrary dimensions, for example:
def my_demo(a, b, c):
return a*a + b*b + c*c
Can be applied arbitrarily to:
arr = np.zeros((1_000_000, 3))
...
but also can be applied to
arr = np.zeros((1_000_000, 3, 500, 1000))
without changing the code.
Currently defining a function inline such as
@fs
def parent(a):
return child(a) * 2
def my_massive_function():
x = 4
def cube(a):
return a * a * a
return parent(x, child=cube)
will fail because the cube
inline function is not within the
parent
function's scope when the AST is re-built within fastats.