@ptrblck
Interesting!!
def forward(x):
        xs = []
        for name, m in itertools.chain(vgg_feature._modules.items(),Attch1._modules.items()):
            print(name,m)
            x = m(x)
        return x
a = forward(torch.rand(1,3,512,512))

it solved the problem! But why should i do that?
Also can you please let me know  your opinion that if the way that i did is a good way in general or not?
if i want to take the output of different layers at the same time
(e.g. last layer after (30): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)
and the layer
(23): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False), )  and send them to two different network (e.g. Attach 1 and Attach2),
how should i do that in this case?
Thanks a lot