Your B tensor is zero dimesional, so you can’t use torch.cat() function to concatenate them.
1)Concatenate them as python array and convert them to tensor
2)Add dimension with unsqueeze() method and use torch.cat()