In pytorch, to update the model, should I use optimizer.step or model.step ? My question also valid for zero_grad() method?
Here is a example snippet:
import torch
import torch nn
class SomeNeuralNet(nn.Module):
    def __init__(self,hs,es,dropout):
          SomeNeuralNet(ClaimRecognizer, self).__init__()
          # Some initialization here
    def forward(x):
          # forward propagation here

model = SomeNeuralNet(es,hs,dp)
optimizer = optim.Adam(model.parameters())
loss_function = nn.NLLLoss()
for epoch in N:
   for x in data:
       # Which one I should call ? optimizer.zero_grad() or model.zero_grad() or both ?       
       model.zero_grad()
       optimizer.zero_grad()
      logp = model(x)
      loss = loss_function(logp,gold_outs)
      loss.backward()
       # Which one I should call ? Optimizer.step() or model.step() or both ?
       optimizer.step()
       model.step()