@omarfoq  Thank you for the help!
Here is a part of my code
                output,em1 = disc(real_image.float()) #Real point cloud data
                _,em2 = disc(inputs2.float()) #Fake or predicted point cloud data
            ls_fake = disc_loss(output, num=1,x=em1,y=em2,pred=True)
            ls_fake.backward()

Here, disc is a model that I am using and em1 and em2 are embedding or features from intermediate layer. So, I basically have to compute MSELoss based on the two em1 and em2. But, I get an error at ls_fake.backward()