SHARE
TWEET

Untitled

a guest Aug 25th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print(labels.detach().numpy())
  2. labels.unsqueeze_(-1)
  3. print(labels.detach().numpy())
  4.  
  5. labels_onehot = torch.FloatTensor(batch_size, 10)
  6. labels_onehot.zero_()
  7. labels_onehot.scatter_(1, labels, 1)
  8. print(labels_onehot.detach().numpy())
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top