Skip to content

Instantly share code, notes, and snippets.

@arunm8489
Created June 5, 2020 04:06
Show Gist options
  • Save arunm8489/05055054c1dd6c8f01f7262d779a6eb5 to your computer and use it in GitHub Desktop.
Save arunm8489/05055054c1dd6c8f01f7262d779a6eb5 to your computer and use it in GitHub Desktop.
non_zero_index = (torch.nonzero(image_pred[:,4])) # non_zero_ind will give the indexes
image_pred_ = image_pred[non_zero_index.squeeze(),:].view(-1,7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment