Exemplo n.º 1
0
def test_edit_distance_error(left_input, right_input, subPen, delPen, insPen,
                             squashInputs, tokensToIgnore, result, device_id,
                             precision):
    i1 = input(shape=(2, ))
    i2 = input(shape=(2, ))
    arguments = {i1: left_input, i2: right_input}
    a = edit_distance_error(i1, i2, subPen, delPen, insPen, squashInputs,
                            tokensToIgnore)
    assert np.allclose(result, a.eval(arguments))
Exemplo n.º 2
0
def test_edit_distance_error(left_input, right_input, subPen, delPen, insPen, squashInputs, tokensToIgnore, result, device_id, precision):
    i1 = input_variable(shape=(2,))
    i2 = input_variable(shape=(2,))
    arguments = {i1 : left_input, i2 : right_input}
    a = edit_distance_error(i1, i2, subPen, delPen, insPen, squashInputs, tokensToIgnore)
    assert np.allclose(result, a.eval(arguments))