예제 #1
0
 def test_nd_sqeezable(self):
     a = np.random.randn(1, 1, 1, 1, 100, 1, 1, 1, 1)
     b = utils.np_squeeze_check(a)
     self._check_data(a, b)
예제 #2
0
 def test_nd(self):
     a = np.random.randn(3, 4, 5, 6, 7, 9)
     with pytest.raises(ValueError) as ex_info:
         utils.np_squeeze_check(a)
예제 #3
0
 def test_row(self):
     a = np.c_[1:10].T
     b = utils.np_squeeze_check(a)
     self._check_data(a, b)
예제 #4
0
 def test_2d(self):
     a = np.c_[1:10, 2:11]
     with pytest.raises(ValueError) as ex_info:
         utils.np_squeeze_check(a)
예제 #5
0
 def test_1d(self):
     a = np.array([1, 2, 3])
     b = utils.np_squeeze_check(a)
     self._check_data(a, b)