Esempio n. 1
0
def test_non_tensor_input():
    shape = (2, 4)
    population = [[1, 2, 3, 4], [1, 2, 3, 4]]
    inputs = Input(shape)
    inputs.assign(population)
    res = inputs.get()
    assert B.is_tensor(res)
Esempio n. 2
0
def test_2d():
    shape = (128, 64, 64)
    population = B.randint(1, 10, shape=shape)
    inputs = Input(shape)
    inputs.assign(population)
    assert B.tensor_equal(inputs.get(), population)
Esempio n. 3
0
def test_call_vs_get():
    shape = (128, 64)
    population = B.randint(1, 10, shape=shape)
    inputs = Input(shape)
    inputs.assign(population)
    assert B.tensor_equal(inputs.get(), inputs.call(''))