The numpy zeros_like function has an extra internal copy to allow
initializing a character array to a string of zeros. This extra
behavior can be costly, for example in scarlet 10% of the processing
time was saved by switching from np.zeros_like(X) to
np.zeros(X.shape dtype=X.dtype).
Also, this adds a test for the function/property spectral_norm in MatrixAdapter, which we need for scarlet.
The numpy zeros_like function has an extra internal copy to allow initializing a character array to a string of zeros. This extra behavior can be costly, for example in scarlet 10% of the processing time was saved by switching from
np.zeros_like(X)
tonp.zeros(X.shape dtype=X.dtype)
.Also, this adds a test for the function/property
spectral_norm
inMatrixAdapter
, which we need for scarlet.