Skip to content

Commit

Permalink
Add test cases for unsupported SequenceMaps
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 582031946
  • Loading branch information
david-lindner committed Nov 13, 2023
1 parent c48c877 commit 72179c9
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion tracr/compiler/test_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,8 @@
]


# Programs using features that are currently not supported by Tracr
# Programs using features that are currently not supported by Tracr and that
# cause the compiler to throw NotImplementerError.
UNSUPPORTED_TEST_CASES = [
dict(
testcase_name="numerical_categorical_aggregate",
Expand Down Expand Up @@ -450,4 +451,29 @@
vocab={1, 2, 3},
max_seq_len=5,
),
dict(
testcase_name="numerical_SequenceMap",
program=rasp.numerical(
rasp.SequenceMap(
lambda x, y: x + y,
rasp.numerical(rasp.Map(lambda x: x, rasp.indices)),
rasp.numerical(rasp.Map(lambda x: x, rasp.tokens)),
)
),
vocab={1, 2, 3},
max_seq_len=5,
),
dict(
testcase_name="categorical_LinearSequenceMap",
program=rasp.categorical(
rasp.LinearSequenceMap(
rasp.categorical(rasp.indices),
rasp.categorical(rasp.tokens),
1,
1,
)
),
vocab={1, 2, 3},
max_seq_len=5,
),
]

0 comments on commit 72179c9

Please sign in to comment.