Sumera_Rounaq:

If I am not passing saved optimizer in my fit function then how it is calculating accuracy and loss?


The optimizer is not calculating the accuracy or loss and is used to update the passed parameter using the already calculated gradients.



 Sumera_Rounaq:

When I am passing optimizer3(saved optimizer) in fit function it is throwing error “Adam is not callable”.


I guess you are passing an optimizer object in this case instead of the function:
model = nn.Linear(1, 1)

# works
opt_func = torch.optim.Adam
optimizer = opt_func(model.parameters(), lr=1e-3)

# raises your error
optimizer = optimizer(model.parameters(), lr=1e-3)
> TypeError: 'Adam' object is not callable