79280316

Date: 2024-12-14 08:33:58
Score: 0.5
Natty:
Report link

I think the best way would be to parallelize the following part of your code with Jax (it can help you even if function1 is not a pure function)

constant_value * (array1[j,k] * function1(i - j))

Pseudo code if it is a pure function:

> Pre-calculate each value for all i and j combinations
> use Jax for parallel multiplication of the above part of the code 
> generate the value of array2[i,k] in the similar way with these precomputed values

If it is not a pure function then you can refer the following link to see how to you can parallelize it. Refer this link

Reasons:
  • Blacklisted phrase (1): this link
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Dhruva-404