How to map tensors of different sizes?

I have a tensor X with dimesions E x p and a second tensor Y with dimenisons C x p. Then I calculated the distance matrix with cdist() which leads me to a tensor Z with dimension E x C. Now, I am searching for an operation in pytorch that maps matrices of size (E,C) and (C, p) to a matrix of size (E, p). What is the best to do this in pytoch?