Hi,
In my resnet class, I defined a list of layers.
for k in range(4):
self.layers[k] = self.make_layer(…)
When running, it showd “Runtime Error: tensors are on different GPUs”, although I have only one GPU.
I modified the code, added something like:
self.layer1 = self.layers[0]
self.layer2 = self.layers[1]
…
in the init function and ran again, everthing is OK.
I guess current .cuda() function cannot copy the content in complex data structure, such as list, to GPU. Am I right?Preformatted text