<p>This itself isn't really an expression but a description of what <span class="math-container">$x_p$</span> looks like. Specifically, <span class="math-container">$x_p$</span> is a real-valued vector with the shape <code>[N, P^2 * C]</code>. Of course, that data comes from your dataset, but as an example</p>
<pre><code>torch.ones(N, P^2 * C, dtype=torch.float32)

# an example output for values N=2, P=2, C=1
&gt;&gt;&gt; [[1., 1., 1., 1.],
     [1., 1., 1., 1.]]
</code></pre>
<p>will give you a vector with the desired shape. Note that this will be a <code>float32</code> vector, which makes it real-valued (<span class="math-container">$x_p \in R$</span>).</p>

CC BY-SA 4.0
2022-06-22T08:22:07.193Z
2022-06-22T08:22:07.193Z
Chillston
<p>I was going through this VIT paper, what will it look like in torch , if we are trying to write this expression.</p>
<p><a href="https://i.sstatic.net/QZkQD.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/QZkQD.png" alt="enter image description here" /></a></p>

CC BY-SA 4.0
2022-06-22T07:11:40.297Z
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}$).
Chillston
CC BY-SA 4.0
2022-06-22T08:15:10.613Z
@Chillston You could write that as an answer instead of a comment.
Neil Slater
CC BY-SA 4.0
2022-06-22T08:22:33.833Z
Of course, sorry
Chillston
<deep-learning><papers><math><notation><vision-transformer>
What do we mean by the notation $\mathbf{x}_{p} \in \mathbb{R}^{N \times\left(P^{2} \cdot C\right)}$?
TheExorcist
# What do we mean by the notation $\mathbf{x}_{p} \in \mathbb{R}^{N \times\left(P^{2} \cdot C\right)}$?

(Asked by: username_0 on 2022-06-22)

I was going through this VIT paper, what will it look like in torch , if we are trying to write this expression.

[![enter image description here](https://i.sstatic.net/QZkQD.png)](https://i.sstatic.net/QZkQD.png)

**Tags:** deep-learning, papers, math, notation, vision-transformer

> **Comments:**
> **username_1**: 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}$).  
> **username_2**: @username_1 You could write that as an answer instead of a comment.  
> **username_1**: Of course, sorry  

---

## 1 answers

### Answer by username_1 on 2022-06-22. Score: 2

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


---

