Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
* Updated the math formulas in summary of `dpnp.matvec` and `dpnp.vecmat` to correct a typo [#2503](https://github.com/IntelPython/dpnp/pull/2503)
* Avoided negating unsigned integers in ceil division used in `dpnp.resize` implementation [#2508](https://github.com/IntelPython/dpnp/pull/2508)
* Fixed `dpnp.unique` with 1d input array and `axis=0`, `equal_nan=True` keywords passed where the produced result doesn't collapse the NaNs [#2530](https://github.com/IntelPython/dpnp/pull/2530)
* Resolved issue when `dpnp.ndarray` constructor is called with `dpnp.ndarray.data` as `buffer` keyword [#2533](https://github.com/IntelPython/dpnp/pull/2533)

### Security

Expand Down
3 changes: 3 additions & 0 deletions dpnp/memory/_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def create_data(x):
)
usm_data = x.usm_data

if isinstance(usm_data, tuple(dispatch.values())):
return usm_data

cls = dispatch.get(type(usm_data), None)
if cls:
data = cls(usm_data)
Expand Down
5 changes: 5 additions & 0 deletions dpnp/tests/test_memory.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,8 @@ def test_wrong_usm_data(self):

with pytest.raises(TypeError):
dpm.create_data(d)

def test_ndarray_from_data(self):
a = dpnp.empty(5)
b = dpnp.ndarray(a.shape, buffer=a.data)
assert b.data.ptr == a.data.ptr
Loading