You need to convert the list of tensors to a tensor (e.g., via cat:
a = torch.cat([a0, ..., a7], dim=1)

You can also use something like torch.gather to avoid manually unrolling all of the assignments.