Skip to content

Commit d19569f

Browse files
author
Vahid Tavanashad
committed
update changelog
1 parent 48fa279 commit d19569f

File tree

8 files changed

+20
-34
lines changed

8 files changed

+20
-34
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88

99
### Added
1010

11+
* Added implementation of `dpnp.hamming` [#2341](https://github.com/IntelPython/dpnp/pull/2341)
12+
1113
### Changed
1214

1315
### Fixed

dpnp/backend/extensions/indexing/indexing_py.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// THE POSSIBILITY OF SUCH DAMAGE.
2424
//*****************************************************************************
2525
//
26-
// This file defines functions of dpnp.backend._lapack_impl extensions
26+
// This file defines functions of dpnp.backend._indexing_impl extensions
2727
//
2828
//*****************************************************************************
2929

dpnp/backend/extensions/statistics/statistics_py.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// THE POSSIBILITY OF SUCH DAMAGE.
2424
//*****************************************************************************
2525
//
26-
// This file defines functions of dpnp.backend._lapack_impl extensions
26+
// This file defines functions of dpnp.backend._statistics_impl extensions
2727
//
2828
//*****************************************************************************
2929

dpnp/backend/extensions/window/hamming.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ namespace py = pybind11;
3232
namespace dpnp::extensions::window
3333
{
3434
void init_hamming(py::module_ m);
35-
} // namespace dpnp::extensions::window
35+
}

dpnp/dpnp_iface_indexing.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,6 @@ def diag_indices(n, ndim=2, device=None, usm_type="device", sycl_queue=None):
476476
:attr:`dpnp.ndarray.device`.
477477
478478
Default: ``None``.
479-
480479
usm_type : {"device", "shared", "host"}, optional
481480
The type of SYCL USM allocation for the output array.
482481
@@ -1084,7 +1083,6 @@ def indices(
10841083
:attr:`dpnp.ndarray.device`.
10851084
10861085
Default: ``None``.
1087-
10881086
usm_type : {"device", "shared", "host"}, optional
10891087
The type of SYCL USM allocation for the output array.
10901088
@@ -1349,7 +1347,6 @@ def mask_indices(
13491347
:attr:`dpnp.ndarray.device`.
13501348
13511349
Default: ``None``.
1352-
13531350
usm_type : {"device", "shared", "host"}, optional
13541351
The type of SYCL USM allocation for the output array.
13551352
@@ -2360,7 +2357,6 @@ def tril_indices(
23602357
:attr:`dpnp.ndarray.device`.
23612358
23622359
Default: ``None``.
2363-
23642360
usm_type : {"device", "shared", "host"}, optional
23652361
The type of SYCL USM allocation for the output array.
23662362
@@ -2570,7 +2566,6 @@ def triu_indices(
25702566
:attr:`dpnp.ndarray.device`.
25712567
25722568
Default: ``None``.
2573-
25742569
usm_type : {"device", "shared", "host"}, optional
25752570
The type of SYCL USM allocation for the output array.
25762571

dpnp/dpnp_iface_manipulation.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -752,7 +752,6 @@ def asarray_chkfinite(
752752
:attr:`dpnp.ndarray.device`.
753753
754754
Default: ``None``.
755-
756755
usm_type : {None, "device", "shared", "host"}, optional
757756
The type of SYCL USM allocation for the output array.
758757

dpnp/dpnp_iface_window.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def hamming(M, device=None, usm_type=None, sycl_queue=None):
109109
110110
Returns
111111
-------
112-
out : dpnp.ndarray
112+
out : dpnp.ndarray of shape (M,)
113113
The window, with the maximum value normalized to one (the value one
114114
appears only if the number of samples is odd).
115115
@@ -153,12 +153,12 @@ def hamming(M, device=None, usm_type=None, sycl_queue=None):
153153
"""
154154

155155
_validate_input(M)
156-
157156
cfd_kwarg = {
158157
"device": device,
159158
"usm_type": usm_type,
160159
"sycl_queue": sycl_queue,
161160
}
161+
162162
if M < 1:
163163
return dpnp.empty(0, **cfd_kwarg)
164164
if M == 1:

dpnp/fft/dpnp_iface_fft.py

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -341,32 +341,22 @@ def fftfreq(n, d=1.0, device=None, usm_type=None, sycl_queue=None):
341341
raise ValueError("`n` should be an integer")
342342
if not dpnp.isscalar(d):
343343
raise ValueError("`d` should be an scalar")
344+
345+
cfd_kwarg = {
346+
"device": device,
347+
"usm_type": usm_type,
348+
"sycl_queue": sycl_queue,
349+
}
350+
344351
val = 1.0 / (n * d)
345-
results = dpnp.empty(
346-
n,
347-
dtype=dpnp.intp,
348-
device=device,
349-
usm_type=usm_type,
350-
sycl_queue=sycl_queue,
351-
)
352+
results = dpnp.empty(n, dtype=dpnp.intp, **cfd_kwarg)
353+
352354
m = (n - 1) // 2 + 1
353-
p1 = dpnp.arange(
354-
0,
355-
m,
356-
dtype=dpnp.intp,
357-
device=device,
358-
usm_type=usm_type,
359-
sycl_queue=sycl_queue,
360-
)
355+
p1 = dpnp.arange(0, m, dtype=dpnp.intp, **cfd_kwarg)
356+
361357
results[:m] = p1
362-
p2 = dpnp.arange(
363-
m - n,
364-
0,
365-
dtype=dpnp.intp,
366-
device=device,
367-
usm_type=usm_type,
368-
sycl_queue=sycl_queue,
369-
)
358+
p2 = dpnp.arange(m - n, 0, dtype=dpnp.intp, **cfd_kwarg)
359+
370360
results[m:] = p2
371361
return results * val
372362

0 commit comments

Comments
 (0)