Skip to content

Extend _tensor_elementwise_impl (unary) part 3#2801

Draft
vlad-perevezentsev wants to merge 17 commits intomove_tensor_elementwise_impl_unary_par_2from
move_tensor_elementwise_impl_unary_par_3
Draft

Extend _tensor_elementwise_impl (unary) part 3#2801
vlad-perevezentsev wants to merge 17 commits intomove_tensor_elementwise_impl_unary_par_2from
move_tensor_elementwise_impl_unary_par_3

Conversation

@vlad-perevezentsev
Copy link
Contributor

This PR extends _tensor_elementwise_impl with the remaining unary functions:

cbrt,
exp2,
proj,
real,
reciprocal,
round,
rsqrt,
sign,
signbit,
sin,
sinh,
sqrt,
square,
tan,
tanh,
trunc,

  • Have you provided a meaningful PR description?
  • Have you added a test, reproducer or referred to an issue with a reproducer?
  • Have you tested your changes locally for CPU and GPU devices?
  • Have you made sure that new changes do not introduce compiler warnings?
  • Have you checked performance impact of proposed changes?
  • Have you added documentation for your changes, if necessary?
  • Have you added your changes to the changelog?

vlad-perevezentsev and others added 8 commits February 25, 2026 00:27
This PR extends `_tensor_impl` in `dpctl_ext.tensor` with the remaining
functions that are explicitly used in `dpnp` implementations (`_take`,
`_full_usm_ndarray`, `_zeros_usm_ndarray`, `_triu`) enabling a complete
switch to `dpctl_ext.tensor._tensor_impl` instead of
`dpctl.tensor._tensor_impl`

It also adds `take()`, `put()`, `full()`,`tril()` and `triu()` to
`dpctl_ext.tensor` and updates the corresponding dpnp functions to use
these implementations internally
This PR extends `_tensor_impl` in `dpctl_ext.tensor` with the copy
functions (`_copy_usm_ndarray_for_reshape` ,
`_copy_numpy_ndarray_into_usm_ndarray`. `_copy_usm_ndarray_for_roll_1d`,
`_copy_usm_ndarray_for_roll_nd`)

It also adds `asnumpy(), astype(), copy(), from_numpy(), to_numpy(),
roll(), and reshape()` to `dpctl_ext.tensor` and updates the
corresponding dpnp functions to use these implementations internally
This PR extends `_tensor_impl` in `dpctl_ext.tensor` with the advanced
indexing (`_extract, _place, _nonzero, mask_positions, `), repeat
(`_cumsum_1d`) and `_eye` functions

It also adds `eye(), extract(), nonzero(), place(), put_along_axis(),
take_along_axis()` to `dpctl_ext.tensor` and updates the corresponding
dpnp functions to use these implementations internally
This PR adds a small clean up to already porting dpctl.tensor code:
* remove unused includes
* add missing includes
* remove redundant namespace qualifications when calling function from
the same namespace
@vlad-perevezentsev vlad-perevezentsev self-assigned this Mar 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

View rendered docs @ https://intelpython.github.io/dpnp/pull/2801/index.html

@vlad-perevezentsev vlad-perevezentsev changed the title Move _tensor_elementwise_impl (unary) part 3 Extend _tensor_elementwise_impl (unary) part 3 Mar 5, 2026
…2778)

This PR extends `_tensor_impl` in `dpctl_ext.tensor` with the `_where,
_clip` and repeat functions
(`_repeat_by_sequence, _repeat_by_scalar`)

It also adds `repeat(), where(), clip()` and `can_cast, finfo, iinfo,
isdtype, result_type` from `_type_utils.py` `to dpctl_ext.tensor and
updates the corresponding dpnp functions to use these implementations
internally
This PR is the final one in the series of extending `_tensor_impl`
extension

It extends `_tensor_impl` in `dpctl_ext.tensor` with linear sequence
functions
(`_linspace_step and _linspace_affine`)

Also this PR significantly expands Python API of `dpctl_ext.tensor` by
adding all missing functions from `dpctl_ext.tensor._ctors` and
`dpctl_ext.tensor._manipulation_functions`

`_tensor_impl`:  45 / 45 functions 
Python API dpctl_ext.tensor:  70 / 233 functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants