Are tables like concattable or paralleltable present in torch
Are there utilities like concattable, paralleltable in pytorch??
gsp-27
No, but you can easily achieve that using autograd. e.g. for concat table: <SCODE>class MyModel(nn.Module):
    def __init__(self):
        self.submodule1 = MySubmodule1()
        self.submodule2 = MySubmodule2()

    def forward(self, x):
        # this is equivalent to ConcatTable containing both submodules,
        # but is much more readable
        concat = [self.submodule1(x), self.submodule2(x)]
        # do some other processing on concat...
<ECODE>
apaszke
I tried the following <SCODE>class MyModel(nn.Module):
    def __init__(self, submod_num,submod_var):
        self.submod_pool = []
        for i in range(submod_num):
            self.submod_pool += [MySubmodule(submod_var[i])]

    def forward(self,X):
        outPool = []
        for submod in self.submod_pool:
            outPool += [submod(X)]

        return torch.cat(outPool,dim)
<ECODE>
thongnguyen
Amir_Ghodrati
I solved it by this: <SCODE> model= nn.Sequential(*layer_list)
<ECODE>
thongnguyen