INNER CODE UNIT · Python

ret

MITDeepLearning/introtodeeplearning · mitdeeplearning/lab1.py:72

    ret = func(*args)
    assert len(ret) == 2, "[FAIL] get_batch must return two arguments (input and label)"
    assert type(ret[0]) == np.ndarray, "[FAIL] test_batch_func_types: x is not np.array"
    assert type(ret[1]) == np.ndarray, "[FAIL] test_batch_func_types: y is not np.array"
    print("[PASS] test_batch_func_types")
    return True


def test_batch_func_shapes(func, args):
    dataset, seq_length, batch_size = args
    x, y = func(*args)
    correct = (batch_size, seq_length)
    assert (
        x.shape == correct
    ), "[FAIL] test_batch_func_shapes: x {} is not correct shape {}".format(
        x.shape, correct
    )
    assert (

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…