Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

fix NDArrayGetData to return to use the right datatype #5629

Merged
merged 2 commits into from
Mar 31, 2017

Conversation

vchuravy
Copy link
Contributor

This failed if one tried to get the underlying data pointer for a NDArray with a dtype other then Float32.
I don't know if any of the other packages need to be adapted. I discovered this while working on the Julia package.

cc: @pluskid

@piiswrong
Copy link
Contributor

Looks like python is not using this function?

@pluskid
Copy link
Contributor

pluskid commented Mar 30, 2017

LGTM. Why is there a perl_test in travis CI?

@vchuravy
Copy link
Contributor Author

I will need the maintainers for the Perl and C++ frontend to have a look at this.

@piiswrong piiswrong merged commit 62d8a5b into apache:master Mar 31, 2017
MXNDArrayGetDType(blob_ptr_->handle, &ret);
return ret;
}

inline const mx_float *NDArray::GetData() const {
Copy link
Contributor

@piiswrong piiswrong Mar 31, 2017

Choose a reason for hiding this comment

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

@lx75249 let's change this to

template<typename DType = mx_float>
inline const DType *NDArray::GetData() const {}

@vchuravy vchuravy deleted the get_dtype branch March 31, 2017 23:41
Guneet-Dhillon pushed a commit to Guneet-Dhillon/mxnet that referenced this pull request Sep 13, 2017
* fix NDArrayGetData to return to use the right datatype

* try to address C++ and Perl
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants