Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Use torch.equal() instead of "==" in Custom Tensorizer tutorial #939

Closed
wants to merge 1 commit into from

Conversation

hudeven
Copy link
Contributor

@hudeven hudeven commented Aug 26, 2019

#528 Motivation and Context

  1. "==" is equivalent to torch.eq() which returns multi-dimensional Tensor and causes "RuntimeError: bool value of Tensor with more than one value is ambiguous"
  2. torch.equal(): returns True if two tensors have the same size and elements, False otherwise.

#934

How Has This Been Tested

N/A, tutorial update

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

1. "==" is equivalent to torch.eq() which returns multi-dimensional Tensor and causes "RuntimeError: bool value of Tensor with more than one value is ambiguous" facebookresearch#934
2. torch.equal(): returns True if two tensors have the same size and elements, False otherwise.
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 26, 2019
@hudeven hudeven changed the title Use torch.equal() instead of "==" Use torch.equal() instead of "==" in Custom Tensorizer tutorial Aug 26, 2019
@hudeven hudeven requested a review from bethebunny August 26, 2019 21:59
@hudeven hudeven self-assigned this Aug 26, 2019
@hudeven hudeven requested a review from chenyangyu1988 August 28, 2019 21:48
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hudeven has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@facebook-github-bot
Copy link
Contributor

@hudeven merged this pull request in 719ba60.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants