def test_3d(self): exp = np.array([[[0.26726124, 0.53452248, 0.80178373], [0.26726124, 0.53452248, 0.80178373], [0.26726124, 0.53452248, 0.80178373]], [[0.26726124, 0.53452248, 0.80178373], [0.26726124, 0.53452248, 0.80178373], [0.26726124, 0.53452248, 0.80178373]]]) got = l2_normalize(np.array([[[1, 2, 3], [1, 2, 3], [1, 2, 3]], [[1, 2, 3], [1, 2, 3], [1, 2, 3]]])) np.testing.assert_allclose(exp, got)
def test_3d(self): exp = np.array([[[0.26726124, 0.53452248, 0.80178373], [0.26726124, 0.53452248, 0.80178373], [0.26726124, 0.53452248, 0.80178373]], [[0.26726124, 0.53452248, 0.80178373], [0.26726124, 0.53452248, 0.80178373], [0.26726124, 0.53452248, 0.80178373]]]) got = l2_normalize( np.array([[[1, 2, 3], [1, 2, 3], [1, 2, 3]], [[1, 2, 3], [1, 2, 3], [1, 2, 3]]])) np.testing.assert_allclose(exp, got)