In teory you are not doing anything wrong.
To get outputs you just have to do the same than for training but adding under the decoration wtih torch.no_grad():
is it not what you tried?
COuld you provide few more details about what does it fail?