No need for np.repeat in normalize_along_axis

This commit is contained in:
Grant Sanderson 2023-01-13 20:34:18 -08:00
parent 071e7f1a74
commit 42909a94ac

View file

@ -193,8 +193,7 @@ def normalize_along_axis(
) -> np.ndarray:
norms = np.sqrt((array * array).sum(axis))
norms[norms == 0] = 1
buffed_norms = np.repeat(norms, array.shape[axis]).reshape(array.shape)
return array / buffed_norms
return (array.T / norms).T
def get_unit_normal(