Created
December 16, 2018 14:46
-
-
Save npetrenko/08dbf72035fe73a33b2cb6497b031289 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_shape(): | |
arr = np.random.normal(size=(2,1,2,3,1,4,5)) | |
boundaries, quantized = quantize(arr, 20) | |
assert np.all(quantized.shape == arr.shape) | |
boundaries_slow, quantized_slow = quantize_slow(arr.reshape(-1), 20) | |
boundaries_slow = boundaries_slow.reshape(boundaries.shape) | |
quantized_slow = quantized_slow.reshape(quantized.shape) | |
assert np.all(boundaries == boundaries_slow) | |
assert np.all(quantized == quantized_slow) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment