Read multiple .gz file and return it in one tensor

I am trying to read multiple .gz file and return its content in one tensor as follows:

value_list = [ ]

with ReadHelper('ark: gunzip -c /home/mnabih/kaldi/egs/timit/s5/exp/mono_ali/*.gz|') as reader:

    for i, b in enumerate(reader):

        value = numpy.asarray(b[1])

        value_list.append(value)

        value = torch.from_numpy(value)

        print(type(value))

it gives me multiple tensors, I tried this command to concatenate it

    values = torch.cat(value, dim = 0, out=None)
But it gives me 

cat() received an invalid combination of arguments - got (Tensor, out=NoneType, dim=int), but expected one of:

  • (tuple of Tensors tensors, name dim, Tensor out)

Could you append tensors to the list and call torch.tensor(value_list)?
This should work:

value = np.random.randn(10, 10)
value_list = []
for _ in range(3):
    value_list.append(value)

res = torch.tensor(value_list)
print(res.shape)
> torch.Size([3, 10, 10])