when x is a vector, derivative of vector diag(f'(x)) is formal notation? https://web.stanford.edu/class/cs224n/readings/gradient-notes.pdf

(4)

this note says this

$$
\frac{\partial \textbf{z}}{\partial \textbf{x}} = \text{diag}(f'(\textbf{x}))
$$

I know this means make a vector to square matrix which has an original vector as diagonal component.

but, since $\textbf{x}$ is a vector, $f'(\textbf{x})$ can't be a vector, derivative of a vector should be a matrix, right? Is this a formal notation for element-wise derivative of vector?
You are partially right and partially wrong: $f'(\textbf{x})$ is a matrix, but $\text{diag}(f'(\textbf{x}))$ means taking the diagonal of that matrix and making a vector out of it.