def test_read_bin_lush_matrix_float_3tensor():
 path = (example_bin_lush_path + 'float_3tensor.lushbin')
 result = read_bin_lush_matrix(path)
 assert (str(result.dtype) == 'float32')
 assert (len(result.shape) == 3)
 if (result.shape != (4, 3, 2)):
  raise AssertionError(('ubyte_3tensor.lushbin stores a 3-tensor of shape (4,3,2), but read_bin_lush_matrix thinks it has shape ' + str(result.shape)))
 for i in xrange(1, (result.shape[0] + 1)):
  for j in xrange(1, (result.shape[1] + 1)):
   for k in xrange(1, (result.shape[2] + 1)):
    assert np.allclose(result[((i - 1), (j - 1), (k - 1))], ((i + (1.5 * j)) + (1.7 * k)))

def test_read_bin_lush_matrix_float_3tensor ( ) : path = ( example_bin_lush_path + 'float_3tensor.lushbin' ) result = read_bin_lush_matrix ( path ) assert ( str ( result . dtype ) == 'float32' ) assert ( len ( result . shape ) == 3 ) if ( result . shape != ( 4 , 3 , 2 ) ) : raise AssertionError ( ( 'ubyte_3tensor.lushbin stores a 3-tensor of shape (4,3,2), but read_bin_lush_matrix thinks it has shape ' + str ( result . shape ) ) ) for i in xrange ( 1 , ( result . shape [ 0 ] + 1 ) ) : for j in xrange ( 1 , ( result . shape [ 1 ] + 1 ) ) : for k in xrange ( 1 , ( result . shape [ 2 ] + 1 ) ) : assert np . allclose ( result [ ( ( i - 1 ) , ( j - 1 ) , ( k - 1 ) ) ] , ( ( i + ( 1.5 * j ) ) + ( 1.7 * k ) ) )
read data from a lush file with float32 data .