Profiling for Roman-CGI found a surprising amount of time occupied by np.array, which is in places like sum_of_2d_modes to make lists and arrays both work on GPU. array will always copy data, while asarray will not if something is already an array. We should use asarray instead.
Profiling for Roman-CGI found a surprising amount of time occupied by
np.array
, which is in places likesum_of_2d_modes
to make lists and arrays both work on GPU.array
will always copy data, whileasarray
will not if something is already an array. We should use asarray instead.