KEMBAR78
Enabled HALF for fill() and zero() methods. Moved them into THTensorFill by izdeby · Pull Request #17536 · pytorch/pytorch · GitHub
Skip to content

Conversation

@izdeby
Copy link
Contributor

@izdeby izdeby commented Feb 27, 2019

For some additional context on this change, please, see this PR

As a part of work on Bool Tensor, we will need to add support for a bool type to _fill() and _zero() methods that are currently located in THTensorMath. As we don't need anything else and those methods are not really math related - we are moving them out into separate THTensorFill for simplicity.

Change:
-moved _fill() and _zero() from THTensorMath.h to THTensorFill
-enabled _fill() and _zero() for HALF type.

@izdeby izdeby requested review from ezyang and gchanan February 27, 2019 03:19
@izdeby izdeby self-assigned this Feb 27, 2019
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.

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

Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

Would be nice if these just got ported to ATen. Doesn't have to be this PR.

name: _th_zero_
cname: zero
return: self
cpu_half: True
Copy link
Contributor

Choose a reason for hiding this comment

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

Add cpu_half test maybe to test_torch?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

zero() and fill() are heavily used in tests, but its a good point about adding a specific test for half type only. this PR is landing right now but i will add these tests as a part of next PR which is in progress right now.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Feb 27, 2019
…ill (#17536)

Summary:
For some additional context on this change, please, see this [PR](pytorch/pytorch#17376)

As a part of work on Bool Tensor, we will need to add support for a bool type to _fill() and _zero() methods that are currently located in THTensorMath. As we don't need anything else and those methods are not really math related - we are moving them out into separate THTensorFill for simplicity.

Change:
-moved _fill() and _zero() from THTensorMath.h to THTensorFill
-enabled _fill() and _zero() for HALF type.
Pull Request resolved: pytorch/pytorch#17536

Differential Revision: D14242130

Pulled By: izdeby

fbshipit-source-id: 1d8bd806f0f5510723b9299d360b70cc4ab96afb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants