Is this what you are after?
m, n = 2, 3
M = torch.randint(10,(m, n))

a, b, c = 2.0, 3.0, 4.0
power = torch.tensor([a,b,c])

torch.pow(M.repeat(power.shape[0],1).reshape(power.shape[0],-1), power.repeat(m*n,1).t()).sum(0).view(m,n)