I checked in forward function using print(self.device). GPU id is cuda:0 and input tensor is  also device=‘cuda:0’
Following define in “def init(self, opt):” function of class
self.r1= nn.Conv2d(6, 20, kernel_size=3,stride=1,padding=1)
Below calling from " def forward(self):" function of class which gives error.
self.A=self.r1(self.A)
Looking after many topic on forum i come to know that model should be run on GPU. But it is already runs on GPU as i print it in forward function.