Fix UB when converting negative floating values to uint8_t#7644
Merged
Fix UB when converting negative floating values to uint8_t#7644
Conversation
See the comment in the code for a detailed description.
goldsborough
approved these changes
May 17, 2018
Contributor
|
@pytorchbot retest this please |
Maratyszcza
reviewed
May 17, 2018
| TH_TENSOR_APPLY2(real, tensor, TYPE_SRC, src, \ | ||
| *tensor_data = static_cast<real>( \ | ||
| static_cast<inter_copy_type_t<real>>( \ | ||
| TH_half2float(*src_data)));) \ |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
ezyang
approved these changes
May 17, 2018
Contributor
|
The macro ifdef to prevent defining the template is a little goofy but we will live. |
Contributor
Author
|
@ezyang I could put the code in |
onnxbot
added a commit
to onnxbot/onnx-fb-universe
that referenced
this pull request
May 18, 2018
…oating values to uint8_t (pytorch/pytorch#7644) pytorch/pytorch@06fa332
petrex
pushed a commit
to petrex/pytorch
that referenced
this pull request
May 23, 2018
…e2_core_hip * 'caffe2_core_hip' of github.com:petrex/pytorch: Refactor cmake files to not add hip includes and libs globally Fix UB when converting negative floating values to uint8_t (pytorch#7644) [auto] Update onnx to 3fc5f43 - move finalize function to be public. (onnx/onnx#987) onnx/onnx@3fc5f43 Fix duplicated thread pool flag [caffe2] Fix warning in net_async_tracing.cc (pytorch#7646) [auto] Update onnx to 8d548e2 - Update shape inference methods to throw exception (onnx/onnx#986) onnx/onnx@8d548e2 Fix flaky atomic iter test (pytorch#7649) Fix onnx Pow export (pytorch#7657) [auto] Update onnx to 8356ad5 - Add unit test framework for the project C++ APIs (onnx/onnx#763) onnx/onnx@8356ad5 [caffe2][nomnigraph] Add registry for optimization passes (pytorch#7656) [auto] Update onnx to 94ca052 - Update mypy version (onnx/onnx#968) onnx/onnx@94ca052 fix nccl distributed documentation
weiyangfb
pushed a commit
to weiyangfb/pytorch
that referenced
this pull request
Jun 11, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See the comment in the code for a detailed description.
cc: @goldsborough @ezyang