# What do we mean by the notation $\mathbf{x}_{p} \in \mathbb{R}^{N \times\left(P^{2} \cdot C\right)}$?

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) will give you a vector with the same shape. Note that this will be a float32 vector, which makes it real-valued ($x_p \in \mathbb{R}$). Jun 22 at 7:11
• @Chillston You could write that as an answer instead of a comment. Jun 22 at 8:15
• Of course, sorry Jun 22 at 8:22

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$$).