The number of tilings of a grid
Haskell, 255…247 242 bytes

-2 bytes thanks to xnor, for suggesting a better partitioning function q.
-8 bytes thanks to ovs, for suggesting [a!!i|i:_&lt;-u] and removing an unnecessary map.


(a#b)c d=sum[1|g&lt;-nub$(permutations(zipWith replicate b[0..]&gt;&gt;=id)&gt;&gt;=q)&gt;&gt;=mapM(q.sort),l g==l c,and[l x==h&amp;&amp;all(==x!!0)x&amp;&amp;sum[a!!i|i:_&lt;-u]==w|(u,w,h)&lt;-zip3 g c d,x&lt;-u]]
q=foldr(\h t-&gt;map([h]:)t++[(h:y):z|y:z&lt;-t])[[]]
l=length
import Data.List

Try it online!
A grid \$\mu\$ is represented as a pair \$(W_\mu,H_\mu)\$ where \$W_\mu\$, \$H_\mu\$ are lists containing, respectively, the widths and the heights of the blocks in \$\mu\$.
The relevant function is (#), which takes as input four lists: a\$=W_\mu\$, b\$=H_\mu\$, c\$=W_\lambda\$, d\$=H_\lambda\$. It returns the integer \$T(\mu,\lambda)\$.