Directly reshaping A will unfortunately not work, as it would result in:
print(A.view(B.size()))
> tensor([[ 1,  1,  1,  1,  1,  2,  2,  2,  2,  2,  3,  3,  3,  3,  3],
          [ 4,  4,  4,  4,  4,  5,  5,  5,  5,  5,  6,  6,  6,  6,  6],
          [ 7,  7,  7,  7,  7,  8,  8,  8,  8,  8,  9,  9,  9,  9,  9],
          [10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12],
          [13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15]])

To get the desired output you would need to permute the first two dimensions first:
print(A.permute(1, 0, 2).reshape(B.size()))
> tensor([[ 1,  1,  1,  1,  1,  6,  6,  6,  6,  6, 11, 11, 11, 11, 11],
          [ 2,  2,  2,  2,  2,  7,  7,  7,  7,  7, 12, 12, 12, 12, 12],
          [ 3,  3,  3,  3,  3,  8,  8,  8,  8,  8, 13, 13, 13, 13, 13],
          [ 4,  4,  4,  4,  4,  9,  9,  9,  9,  9, 14, 14, 14, 14, 14],
          [ 5,  5,  5,  5,  5, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15]])