def test_read_bin_lush_matrix_int_3tensor():
    path = example_bin_lush_path + 'int_3tensor.lushbin'
    result = read_bin_lush_matrix(path)

    assert str(result.dtype) == 'int32'

    assert len(result.shape) == 3
    if result.shape != (3, 2, 4):
        raise AssertionError(
            "ubyte_3tensor.lushbin stores a 3-tensor "
            "of shape (3,2,4), 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 (result[i - 1, j - 1, k - 1] ==
                        (i + 10000 ** j) * ((-2) ** k))
Read data from a lush file with int32 data (3D-tensor)
dataset/ETHPy150Open lisa-lab/pylearn2/pylearn2/utils/tests/test_serial.py/test_read_bin_lush_matrix_int_3tensor