(model, inputs)
| 101 | # also encapsulate these steps |
| 102 | # Note: inputs is a torch tensor |
| 103 | def predict(model, inputs): |
| 104 | inputs = Variable(inputs, requires_grad=False) |
| 105 | logits = model.forward(inputs) |
| 106 | return logits.data.numpy().argmax(axis=1) |
| 107 | |
| 108 | |
| 109 | # return the accuracy |