Let us consider the case of a square matrix $n \times n$ matrix $W$.
You have to consider all ways of writing $n$ as the product of two numbers $n=pq$.
Let us take for simplifying the formulas to come that $n=6$ with $p=2$ and $q=3$.
For each such writings consider a partition of $W$ in $q$ times $p \times p$ blocks under the form :
$$W=\left[\begin{array}{c|c} W_{11}& W_{12}& W_{13}\\\hlineW_{21}& W_{22}& W_{23}\\\hlineW_{31}& W_{32}& W_{33}\end{array}\right]$$
Identify one of the blocks having at least one nonzero entry. Assume for the sake of simplicity that it is the upper-left block $W_{11}$; call it $B$.
Then, under the condition that all other blocks are proportional to $B$, i.e., giving $W$ the following aspect :
$$W=\left[\begin{array}{c|c} B&aB&bB\\\hlinecB&dB&eB\\\hlinefB&gB&hB\end{array}\right]=A \otimes B \ \ \text{with} \ \ A:=\left[\begin{array}{cc} 1&a&b\\ c&d&e\\ f&g&h\end{array}\right]$$
Please note the lack of unicity : $A \otimes B = kA \otimes \tfrac{1}{k}B $ for any non zero real number $k$.
Remark : the cases where $W$ is a rectangular matrix $n_1 \times n_2$ can be treated in a very similar manner, this time by considering the different ways to write $n_1=p_1q_1$ and $n_2=p_2q_2$.