Skip to content

Commit 68e858e

Browse files
implement dpnp.nanmedian e0769fc
1 parent e398a05 commit 68e858e

File tree

1,032 files changed

+2253
-1956
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,032 files changed

+2253
-1956
lines changed

pull/2191/.buildinfo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# Sphinx build info version 1
22
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3-
config: 015fb289755b5c47f8c63d689a9041a5
3+
config: 36b1bab48cb6a5c8319b3a937a4459fa
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

pull/2191/_modules/dpnp/dpnp_array.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_array &mdash; Data Parallel Extension for NumPy 0.17.0dev2+36.ge9151be6171 documentation</title>
17+
<title>dpnp.dpnp_array &mdash; Data Parallel Extension for NumPy 0.17.0dev3+11.ge0769fcfb3b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=c70b70db"></script>
24+
<script src="../../_static/documentation_options.js?v=fdd2f116"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

pull/2191/_modules/dpnp/dpnp_flatiter.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.17.0dev2+36.ge9151be6171 documentation</title>
17+
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.17.0dev3+11.ge0769fcfb3b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=c70b70db"></script>
24+
<script src="../../_static/documentation_options.js?v=fdd2f116"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

pull/2191/_modules/dpnp/dpnp_iface.html

Lines changed: 2 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.17.0dev2+36.ge9151be6171 documentation</title>
17+
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.17.0dev3+11.ge0769fcfb3b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=c70b70db"></script>
24+
<script src="../../_static/documentation_options.js?v=fdd2f116"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>
@@ -147,7 +147,6 @@ <h1>Source code for dpnp.dpnp_iface</h1><div class="highlight"><pre>
147147
<span class="s2">&quot;check_limitations&quot;</span><span class="p">,</span>
148148
<span class="s2">&quot;check_supported_arrays_type&quot;</span><span class="p">,</span>
149149
<span class="s2">&quot;default_float_type&quot;</span><span class="p">,</span>
150-
<span class="s2">&quot;from_dlpack&quot;</span><span class="p">,</span>
151150
<span class="s2">&quot;get_dpnp_descriptor&quot;</span><span class="p">,</span>
152151
<span class="s2">&quot;get_include&quot;</span><span class="p">,</span>
153152
<span class="s2">&quot;get_normalized_queue_device&quot;</span><span class="p">,</span>
@@ -534,63 +533,6 @@ <h1>Source code for dpnp.dpnp_iface</h1><div class="highlight"><pre>
534533
<span class="k">return</span> <span class="n">map_dtype_to_device</span><span class="p">(</span><span class="n">float64</span><span class="p">,</span> <span class="n">_sycl_queue</span><span class="o">.</span><span class="n">sycl_device</span><span class="p">)</span>
535534

536535

537-
<div class="viewcode-block" id="from_dlpack">
538-
<a class="viewcode-back" href="../../reference/generated/dpnp.from_dlpack.html#dpnp.from_dlpack">[docs]</a>
539-
<span class="k">def</span> <span class="nf">from_dlpack</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="o">/</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">device</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
540-
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
541-
<span class="sd"> Create a dpnp array from a Python object implementing the ``__dlpack__``</span>
542-
<span class="sd"> protocol.</span>
543-
544-
<span class="sd"> See https://dmlc.github.io/dlpack/latest/ for more details.</span>
545-
546-
<span class="sd"> Parameters</span>
547-
<span class="sd"> ----------</span>
548-
<span class="sd"> obj : object</span>
549-
<span class="sd"> A Python object representing an array that implements the ``__dlpack__``</span>
550-
<span class="sd"> and ``__dlpack_device__`` methods.</span>
551-
<span class="sd"> device : {:class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue`,</span>
552-
<span class="sd"> :class:`dpctl.tensor.Device`, tuple, None}, optional</span>
553-
<span class="sd"> Array API concept of a device where the output array is to be placed.</span>
554-
<span class="sd"> ``device`` can be ``None``, an oneAPI filter selector string,</span>
555-
<span class="sd"> an instance of :class:`dpctl.SyclDevice` corresponding to</span>
556-
<span class="sd"> a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`,</span>
557-
<span class="sd"> a :class:`dpctl.tensor.Device` object returned by</span>
558-
<span class="sd"> :attr:`dpctl.tensor.usm_ndarray.device`, or a 2-tuple matching</span>
559-
<span class="sd"> the format of the output of the ``__dlpack_device__`` method,</span>
560-
<span class="sd"> an integer enumerator representing the device type followed by</span>
561-
<span class="sd"> an integer representing the index of the device.</span>
562-
<span class="sd"> Default: ``None``.</span>
563-
<span class="sd"> copy {bool, None}, optional</span>
564-
<span class="sd"> Boolean indicating whether or not to copy the input.</span>
565-
566-
<span class="sd"> * If `copy``is ``True``, the input will always be copied.</span>
567-
<span class="sd"> * If ``False``, a ``BufferError`` will be raised if a copy is deemed</span>
568-
<span class="sd"> necessary.</span>
569-
<span class="sd"> * If ``None``, a copy will be made only if deemed necessary, otherwise,</span>
570-
<span class="sd"> the existing memory buffer will be reused.</span>
571-
572-
<span class="sd"> Default: ``None``.</span>
573-
574-
<span class="sd"> Returns</span>
575-
<span class="sd"> -------</span>
576-
<span class="sd"> out : dpnp_array</span>
577-
<span class="sd"> Returns a new dpnp array containing the data from another array</span>
578-
<span class="sd"> (obj) with the ``__dlpack__`` method on the same device as object.</span>
579-
580-
<span class="sd"> Raises</span>
581-
<span class="sd"> ------</span>
582-
<span class="sd"> TypeError:</span>
583-
<span class="sd"> if `obj` does not implement ``__dlpack__`` method</span>
584-
<span class="sd"> ValueError:</span>
585-
<span class="sd"> if the input array resides on an unsupported device</span>
586-
587-
<span class="sd"> &quot;&quot;&quot;</span>
588-
589-
<span class="n">usm_res</span> <span class="o">=</span> <span class="n">dpt</span><span class="o">.</span><span class="n">from_dlpack</span><span class="p">(</span><span class="n">obj</span><span class="p">,</span> <span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span>
590-
<span class="k">return</span> <span class="n">dpnp_array</span><span class="o">.</span><span class="n">_create_from_usm_ndarray</span><span class="p">(</span><span class="n">usm_res</span><span class="p">)</span></div>
591-
592-
593-
594536
<span class="k">def</span> <span class="nf">get_dpnp_descriptor</span><span class="p">(</span>
595537
<span class="n">ext_obj</span><span class="p">,</span>
596538
<span class="n">copy_when_strides</span><span class="o">=</span><span class="kc">True</span><span class="p">,</span>

pull/2191/_modules/dpnp/dpnp_iface_arraycreation.html

Lines changed: 93 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_iface_arraycreation &mdash; Data Parallel Extension for NumPy 0.17.0dev2+36.ge9151be6171 documentation</title>
17+
<title>dpnp.dpnp_iface_arraycreation &mdash; Data Parallel Extension for NumPy 0.17.0dev3+11.ge0769fcfb3b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=c70b70db"></script>
24+
<script src="../../_static/documentation_options.js?v=fdd2f116"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>
@@ -160,6 +160,7 @@ <h1>Source code for dpnp.dpnp_iface_arraycreation</h1><div class="highlight"><pr
160160
<span class="s2">&quot;fromfunction&quot;</span><span class="p">,</span>
161161
<span class="s2">&quot;fromiter&quot;</span><span class="p">,</span>
162162
<span class="s2">&quot;fromstring&quot;</span><span class="p">,</span>
163+
<span class="s2">&quot;from_dlpack&quot;</span><span class="p">,</span>
163164
<span class="s2">&quot;full&quot;</span><span class="p">,</span>
164165
<span class="s2">&quot;full_like&quot;</span><span class="p">,</span>
165166
<span class="s2">&quot;geomspace&quot;</span><span class="p">,</span>
@@ -2183,6 +2184,96 @@ <h1>Source code for dpnp.dpnp_iface_arraycreation</h1><div class="highlight"><pr
21832184

21842185

21852186

2187+
<div class="viewcode-block" id="from_dlpack">
2188+
<a class="viewcode-back" href="../../reference/generated/dpnp.from_dlpack.html#dpnp.from_dlpack">[docs]</a>
2189+
<span class="k">def</span> <span class="nf">from_dlpack</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="o">/</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">device</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
2190+
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
2191+
<span class="sd"> Constructs :class:`dpnp.ndarray` or :class:`numpy.ndarray` instance from</span>
2192+
<span class="sd"> a Python object `x` that implements ``__dlpack__`` protocol.</span>
2193+
2194+
<span class="sd"> For full documentation refer to :obj:`numpy.from_dlpack`.</span>
2195+
2196+
<span class="sd"> Parameters</span>
2197+
<span class="sd"> ----------</span>
2198+
<span class="sd"> x : object</span>
2199+
<span class="sd"> A Python object representing an array that implements the ``__dlpack__``</span>
2200+
<span class="sd"> and ``__dlpack_device__`` methods.</span>
2201+
<span class="sd"> device : {None, string, tuple, device}, optional</span>
2202+
<span class="sd"> Device where the output array is to be placed. `device` keyword values</span>
2203+
<span class="sd"> can be:</span>
2204+
2205+
<span class="sd"> * ``None`` : The data remains on the same device.</span>
2206+
<span class="sd"> * oneAPI filter selector string : SYCL device selected by filter</span>
2207+
<span class="sd"> selector string.</span>
2208+
<span class="sd"> * :class:`dpctl.SyclDevice` : Explicit SYCL device that must correspond</span>
2209+
<span class="sd"> to a non-partitioned SYCL device.</span>
2210+
<span class="sd"> * :class:`dpctl.SyclQueue` : Implies SYCL device targeted by the SYCL</span>
2211+
<span class="sd"> queue.</span>
2212+
<span class="sd"> * :class:`dpctl.tensor.Device` : Implies SYCL device</span>
2213+
<span class="sd"> ``device.sycl_queue``. The `device` object is obtained via</span>
2214+
<span class="sd"> :attr:`dpctl.tensor.usm_ndarray.device`.</span>
2215+
<span class="sd"> * ``(device_type, device_id)`` : 2-tuple matching the format of the</span>
2216+
<span class="sd"> output of the ``__dlpack_device__`` method: an integer enumerator</span>
2217+
<span class="sd"> representing the device type followed by an integer representing</span>
2218+
<span class="sd"> the index of the device. The only supported :class:`dpnp.DLDeviceType`</span>
2219+
<span class="sd"> device types are ``&quot;kDLCPU&quot;`` and ``&quot;kDLOneAPI&quot;``.</span>
2220+
2221+
<span class="sd"> Default: ``None``.</span>
2222+
<span class="sd"> copy : {bool, None}, optional</span>
2223+
<span class="sd"> Boolean indicating whether or not to copy the input.</span>
2224+
2225+
<span class="sd"> * If `copy` is ``True``, the input will always be copied.</span>
2226+
<span class="sd"> * If ``False``, a ``BufferError`` will be raised if a copy is deemed</span>
2227+
<span class="sd"> necessary.</span>
2228+
<span class="sd"> * If ``None``, a copy will be made only if deemed necessary, otherwise,</span>
2229+
<span class="sd"> the existing memory buffer will be reused.</span>
2230+
2231+
<span class="sd"> Default: ``None``.</span>
2232+
2233+
<span class="sd"> Returns</span>
2234+
<span class="sd"> -------</span>
2235+
<span class="sd"> out : {dpnp.ndarray, numpy.ndarray}</span>
2236+
<span class="sd"> An array containing the data in `x`. When `copy` is ``None`` or</span>
2237+
<span class="sd"> ``False``, this may be a view into the original memory.</span>
2238+
<span class="sd"> The type of the returned object depends on where the data backing up</span>
2239+
<span class="sd"> input object `x` resides. If it resides in a USM allocation on a SYCL</span>
2240+
<span class="sd"> device, the type :class:`dpnp.ndarray` is returned, otherwise if it</span>
2241+
<span class="sd"> resides on ``&quot;kDLCPU&quot;`` device the type is :class:`numpy.ndarray`, and</span>
2242+
<span class="sd"> otherwise an exception is raised.</span>
2243+
2244+
<span class="sd"> Raises</span>
2245+
<span class="sd"> ------</span>
2246+
<span class="sd"> TypeError</span>
2247+
<span class="sd"> if `obj` does not implement ``__dlpack__`` method</span>
2248+
<span class="sd"> ValueError</span>
2249+
<span class="sd"> if data of the input object resides on an unsupported device</span>
2250+
2251+
<span class="sd"> Notes</span>
2252+
<span class="sd"> -----</span>
2253+
<span class="sd"> If the return type is :class:`dpnp.ndarray`, the associated SYCL queue is</span>
2254+
<span class="sd"> derived from the `device` keyword. When `device` keyword value has type</span>
2255+
<span class="sd"> :class:`dpctl.SyclQueue`, the explicit queue instance is used, when `device`</span>
2256+
<span class="sd"> keyword value has type :class:`dpctl.tensor.Device`, the</span>
2257+
<span class="sd"> ``device.sycl_queue`` is used. In all other cases, the cached SYCL queue</span>
2258+
<span class="sd"> corresponding to the implied SYCL device is used.</span>
2259+
2260+
<span class="sd"> Examples</span>
2261+
<span class="sd"> --------</span>
2262+
<span class="sd"> &gt;&gt;&gt; import dpnp as np</span>
2263+
<span class="sd"> &gt;&gt;&gt; import numpy</span>
2264+
<span class="sd"> &gt;&gt;&gt; x = numpy.arange(10)</span>
2265+
<span class="sd"> &gt;&gt;&gt; # create a view of the numpy array &quot;x&quot; in dpnp:</span>
2266+
<span class="sd"> &gt;&gt;&gt; y = np.from_dlpack(x)</span>
2267+
2268+
<span class="sd"> &quot;&quot;&quot;</span>
2269+
2270+
<span class="n">result</span> <span class="o">=</span> <span class="n">dpt</span><span class="o">.</span><span class="n">from_dlpack</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">,</span> <span class="n">copy</span><span class="o">=</span><span class="n">copy</span><span class="p">)</span>
2271+
<span class="k">if</span> <span class="nb">isinstance</span><span class="p">(</span><span class="n">result</span><span class="p">,</span> <span class="n">dpt</span><span class="o">.</span><span class="n">usm_ndarray</span><span class="p">):</span>
2272+
<span class="k">return</span> <span class="n">dpnp_array</span><span class="o">.</span><span class="n">_create_from_usm_ndarray</span><span class="p">(</span><span class="n">result</span><span class="p">)</span>
2273+
<span class="k">return</span> <span class="n">result</span></div>
2274+
2275+
2276+
21862277
<div class="viewcode-block" id="full">
21872278
<a class="viewcode-back" href="../../reference/generated/dpnp.full.html#dpnp.full">[docs]</a>
21882279
<span class="k">def</span> <span class="nf">full</span><span class="p">(</span>

pull/2191/_modules/dpnp/dpnp_iface_bitwise.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_iface_bitwise &mdash; Data Parallel Extension for NumPy 0.17.0dev2+36.ge9151be6171 documentation</title>
17+
<title>dpnp.dpnp_iface_bitwise &mdash; Data Parallel Extension for NumPy 0.17.0dev3+11.ge0769fcfb3b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=c70b70db"></script>
24+
<script src="../../_static/documentation_options.js?v=fdd2f116"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

pull/2191/_modules/dpnp/dpnp_iface_counting.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
</script>
1515

1616
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
17-
<title>dpnp.dpnp_iface_counting &mdash; Data Parallel Extension for NumPy 0.17.0dev2+36.ge9151be6171 documentation</title>
17+
<title>dpnp.dpnp_iface_counting &mdash; Data Parallel Extension for NumPy 0.17.0dev3+11.ge0769fcfb3b documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
1919
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
2020

2121

2222
<script src="../../_static/jquery.js?v=5d32c60e"></script>
2323
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24-
<script src="../../_static/documentation_options.js?v=c70b70db"></script>
24+
<script src="../../_static/documentation_options.js?v=fdd2f116"></script>
2525
<script src="../../_static/doctools.js?v=9bcbadda"></script>
2626
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
2727
<script src="../../_static/js/theme.js"></script>

0 commit comments

Comments
 (0)