@charan_Vjy I have done the same as you are saying, actually I am  using two linear layers as given below
 self.fc1=nn.Linear(2048,246)
 self.fc2=nn.Linear(246,num_classes)

I am getting an error
size mismatch, m1: [2048 x 246], m2: [2048 x 246] at C:/cb/pytorch_1000000000000/work/aten/src\THC/generic/THCTensorMathBlas.cu:283
Is there any problem in code?
@ptrblck sir