I have an empty tensor wrapped in Variable
result = Variable(torch.Tensor().cuda())
and another non-empty cuda tensor wrapped in Variable which is output of a network 1
temp = self.forward(model, input)
temp = temp.view(-1)
How can I concatenate result and temp Variables?
result = torch.cat([result,temp]) throws the below error.
RuntimeError: dimension specified as 0 but tensor has no dimensions
This is with reference to this part of code 1, that I’m trying to port to pytorch. Thank you.
EDIT: some like below tensorflow code
result = []
input_downsampled = input
for i in range(3):
       result.append(self.forward(model, input_downsampled))
       if i != (2):
            input_downsampled = self.downsample(input_downsampled)
return result