I was going through this VIT paper, what will it look like in torch , if we are trying to write this expression.
This itself isn't really an expression but a description of what $x_p$ looks like. Specifically, $x_p$ is a real-valued vector with the shape
[N, P^2 * C]. Of course, that data comes from your dataset, but as an example
torch.ones(N, P^2 * C, dtype=torch.float32) # an example output for values N=2, P=2, C=1 >>> [[1., 1., 1., 1.], [1., 1., 1., 1.]]
will give you a vector with the desired shape. Note that this will be a
float32 vector, which makes it real-valued ($x_p \in R$).