You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2021/09/10 16:18:50 UTC

[GitHub] [incubator-mxnet] ptrendx commented on pull request #20470: Fix an array iterator in nnvm_to_onnx

ptrendx commented on pull request #20470:
URL: https://github.com/apache/incubator-mxnet/pull/20470#issuecomment-917032352


   Hmm, I don't think that the fix for the odd size is right - you still can read beyond the original size. I would frankly just allocate the shared_data_ptr as uint32_t with `(size + 1) / 2` elements and then set the last element to 0 if the size is odd (just to not include garbage in your actual output). Then do the memcopy. That way you avoid 2 problems:
    - currently your shared_data_ptr could be aligned to just 2 bytes, whereas to read it as uint32_t you need to have 4 byte alignment
    - if the size is odd you still read beyond the end of array 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@mxnet.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org