Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use dtype of RHS in NdArray.data setter #527

Merged
merged 6 commits into from
Oct 21, 2019

Conversation

TakuyaNarihira
Copy link
Contributor

Previously, there was an issue that an array with any dtype is automatically converted to fp32 at the first call of .data property in an instance of NdArray.

a = np.arange(10)  # int64
b = NdArray(a.shape)
b.data = a  # b.dtype becomes float32 

By this change, the setter uses a dtype of RHS as following.

b.data = a # b.dtype becomes int64

There is an exception where zero() or fill(rhs) is invoked if a scalar with a float or an integer <= 2^53 (as value to be filled is maintained as float64) is given.

Additionally, resolved the following;

  • Remove unnecessary prints in testing
  • Properly raises an exception in function call, and fix min-max quantize affine

@TakuyaNarihira TakuyaNarihira added the release-note-core Auto-release; Core Engine label Oct 21, 2019
@KazukiYoshiyama-sony KazukiYoshiyama-sony merged commit 5388c49 into master Oct 21, 2019
@YukioOobuchi YukioOobuchi deleted the feature/20191011-ndarray-data-rhs-dtype branch January 20, 2020 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-core Auto-release; Core Engine
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants