The miracle of python is that it has standard syntax for vectorized code across many packages.
For i in range(100):
mask = lib.abs2(z) < 4
subset = z[mask]
subc = c[mask]
subcounts = 0
for j in range(100):
subcounts = subcounts + lib.abs2 (subset )< 4
subz = subz**2 + subc
Z[mask] = subset
Counts[mask] += subcounts
Was that code using numpy, tensorflow, torch, arrayfire, or some proprietary amd gpu lib? It’s hard to say!Try the same with eigen vs arrayfire in C++ or math.js vs tensorflow.js and you will have to do a hell of a lot more than change the value of lib