def test_validate_abstract_2(): bad_array = AbstractArray(to_abstract_test(f64), { SHAPE: (1, 2), TYPE: PyTorchTensor }) with pytest.raises(ValidationError): validate_abstract(bad_array, {})
def test_validate_abstract(): fn = AbstractFunction( VirtualFunction((), to_abstract_test(i64)), VirtualFunction((), to_abstract_test(f64)), ) with pytest.raises(ValidationError): validate_abstract(fn, {})
def test_validate_abstract_2(): fn = AbstractFunction( VirtualFunction( (), AbstractArray(to_abstract_test(f64), { SHAPE: (1, 2), TYPE: PyTorchTensor }), ), ) with pytest.raises(ValidationError): validate_abstract(fn, {})
def test_validate_abstract(): scalar_i64 = to_abstract_test(i64) fn = AbstractFunction( TypedPrimitive(P.scalar_add, (scalar_i64, scalar_i64), scalar_i64), ) with pytest.raises(ValidationError): validate_abstract(fn, {})