MCPcopy Index your code
hub / github.com/lazyprogrammer/machine_learning_examples / predict

Function predict

ann_class2/pytorch_example.py:93–96  ·  view source on GitHub ↗
(model, inputs)

Source from the content-addressed store, hash-verified

91# also encapsulate these steps
92# Note: inputs is a torch tensor
93def predict(model, inputs):
94 inputs = Variable(inputs, requires_grad=False)
95 logits = model.forward(inputs)
96 return logits.data.numpy().argmax(axis=1)
97
98
99

Callers 1

pytorch_example.pyFile · 0.70

Calls 1

forwardMethod · 0.45

Tested by

no test coverage detected