-
Notifications
You must be signed in to change notification settings - Fork 22
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
Asanyarray ascontiguousarray asfarray copy funcs #265
Conversation
@@ -187,7 +187,8 @@ void func_map_init_random(func_map_t& fmap) | |||
fmap[DPNPFuncName::DPNP_FN_GAUSSIAN][eft_DBL][eft_DBL] = {eft_DBL, (void*)custom_rng_gaussian_c<double>}; | |||
fmap[DPNPFuncName::DPNP_FN_GAUSSIAN][eft_FLT][eft_FLT] = {eft_FLT, (void*)custom_rng_gaussian_c<float>}; | |||
|
|||
fmap[DPNPFuncName::DPNP_FN_NEGATIVE_BINOMIAL][eft_INT][eft_INT] = {eft_INT, (void*)custom_rng_negative_binomial_c<int>}; | |||
fmap[DPNPFuncName::DPNP_FN_NEGATIVE_BINOMIAL][eft_INT][eft_INT] = {eft_INT, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not look like these changes belong to this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is a result of applying of code style tool... The correct way is to apply code style tool during work on changes, but if someone missed it, then these changes occur when I apply code style. Sometimes it is hard to split these changes in new and old code. We should improve our CI to automatic check/apply of code style.
dpnp/dparray.pyx
Outdated
@@ -47,6 +47,47 @@ cimport numpy | |||
cimport dpnp.dpnp_utils as utils | |||
|
|||
|
|||
# initially copyed from original |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
copyed->copied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Alexander-Makaryev it looks like it is related to #89
@@ -47,6 +47,47 @@ cimport numpy | |||
cimport dpnp.dpnp_utils as utils | |||
|
|||
|
|||
# initially copyed from original | |||
cdef class _flagsobj: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don not understand why we need this. It is better to reuse this from NumPy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to get own behavior while we have no a full enough support of features like f-contiguous memory layout, strides, views (sharing the memory) etc. In fact at this moment we just return a constant values of flags and it will be easier to modify our own class "step by step". We can replace it with original Numpy class in future, when it will be possible to reuse original functionality. Possibly I am wrong)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Alexander-Makaryev We "return a constant values" because we support one data state only at this time.
It is questionable we will support diffrent states.
Using Numpy Flags is also possible in "one state"- just construct it based on "constant values".
I think this is ambiguous code what is better to handle via "fallback" because it is not related to SYCL
|
||
if ndmin != 0: | ||
checker_throw_value_error("array", "ndmin", ndmin, 0) | ||
|
||
return dpnp_array(obj, dtype) | ||
|
||
|
||
def asanyarray(a, dtype=None, order=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add block Limitations
to all the docstring something like this:
Limitations
-----------
Parameter ``order`` is supported only with default value `'C'`.
+21 passed cupy tests
+15 in tests/test_arraymanipulation.py