Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Conversation

youben11
Copy link
Contributor

@youben11 youben11 commented May 8, 2020

Types of changes

  • 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)
  • Docs change / refactoring / dependency upgrade

Motivation and Context / Related issue

There is an issue with setting a torch tensor using the .data attribute here and here, those lines are throwing an AttributeError: can't set attribute. My use-case uses PySyft which might be the cause of throwing that error but I believe that using .set_ instead won't affect the current implementation. I got the fix from a related issue pytorch/pytorch#30987

How Has This Been Tested (if it applies)

A complete training of the same model in Tutorial7.

Checklist

  • The documentation is up-to-date with the changes I made.
  • I have read the CONTRIBUTING document and completed the CLA (see CONTRIBUTING).
  • All tests passed, and additional code has been covered with new tests.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 8, 2020
@lvdmaaten lvdmaaten self-requested a review May 8, 2020 13:47
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.

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

@facebook-github-bot
Copy link
Contributor

@lvdmaaten merged this pull request in 5970e4d.

result.share.data = getattr(beaver, op)(
result, y, *args, **kwargs
).share.data
result.share.set_(getattr(beaver, op)(
Copy link

Choose a reason for hiding this comment

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

I think the comment above is stale now.

Is the .data below still needed? I think in pytorch we intend to eventually deprecate .data.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants