Skip to content

Conversation

@bhushan23
Copy link
Contributor

Introduces torch.isinf for issue #9132

"""
if not torch.is_tensor(tensor):
raise ValueError("The argument is not a tensor")
return (tensor == float('inf')) | (tensor == float('-inf'))

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants