How to represent those types of values in a tensor?
I have a dataset like this:
(0, 1), UpDownUpUp            
(2, 3), UpUpUpDownDownDown   
(0, 2), DownUp               
(0, Undefined), DownUp   

How to represent this type of data in a PyTorch tensor? So I can then train a neural network with it?

Here is one way to do it:

You keep the values as they are, replacing the undefined with 9 (we will use 9 to represent [do nothing])
You encode the labels into integers 5, 6
Convert your variables into lists
For every batch, take the length of the longest sequence
Pad the input and the labels with 9s to match the length you found at previous step

Resulting dataset will look like the following input and target pairs:
[0, 1, 9, 9, 9, 9], [5, 6, 5, 5, 9, 9]
[2 ,3, 9, 9, 9, 9], [5, 5, 5, 6, 6, 6]
[0, 2, 9, 9, 9, 9], [6, 5, 9, 9, 9, 9]
[0, 9, 9, 9, 9, 9], [6, 5, 9, 9, 9, 9]

