Can you tell me what do you mean by passing the wieights manually?
I mean if i use lossFn=nn.CrossEntropyLoss()
then the code i use is:

optimiser = optim.SGD(net.parameters(), lr = 0.01, momentum=0.9)
loss = lossFn(output,actual)
optimiser.zero_grad()
loss.backward()
optimiser.step()

What differently do i have to do with the functionall one?
Thanks in advance