I assume you would like to feed the batch to the first layer and then pipe the output through all others?
If so, then this code snippet should work:
out = self.a[0](X)
for i in range(1, 10):
    out = self.a[i](out)