Hi,
I wrote a custom backward function for my model. I want to use the DataParallel package. However I have a problem. If I use
model = torch.nn.DataParallel(model, device_ids=[0,1])

I get the following error:
“‘DataParallel’ object has no attribute ‘backward’”
I know this can be solved by using model.module.backward, but then it will only use one gpu. Is there a way to use the torch.nn.DataParallel with custom backward and attributes?