Premium problem59. Logits to Predicted Binary Labels

Easy Locked

Convert raw binary-classification logits into 0/1 predicted labels: apply sigmoid, then round to the nearest integer.

Input

tensor([-1.2000,  0.3000,  2.5000, -0.1000])

Output

tensor([0., 1., 1., 0.])

Premium problem

This one's part of Premium. Unlock the full PyTorch track plus every other premium problem on the site.

Implement solve(...)