I have 3 matrices B (dim:100x100) , A(dim:10x10), C(dim:5x5). I want to pad the left side of B , i.e., concat the left side of B with 10 A’s to match the dimension and also do the same on the right but with 20 C’s instead. Please may I know an efficient way to do this?
not sure if anything would work better than partial assignments (with broadcasting):
D = torch.empty(100,115) D[:,:10].view(-1,10,10).copy_(A) #similar for B,C