Skip to content

Commit 33e595d

Browse files
Bump github/codeql-action from 3.27.1 to 3.27.4 25f98f7
1 parent 47897ab commit 33e595d

File tree

2,025 files changed

+246630
-0
lines changed

Some content is hidden

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

2,025 files changed

+246630
-0
lines changed

pull/2176/.buildinfo

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: b2068cf34aa2d186b538713244c6d53b
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7

pull/2176/.nojekyll

Whitespace-only changes.

pull/2176/_modules/dpnp/dpnp_array.html

Lines changed: 2044 additions & 0 deletions
Large diffs are not rendered by default.

pull/2176/_modules/dpnp/dpnp_flatiter.html

Lines changed: 218 additions & 0 deletions
Large diffs are not rendered by default.

pull/2176/_modules/dpnp/dpnp_iface.html

Lines changed: 918 additions & 0 deletions
Large diffs are not rendered by default.

pull/2176/_modules/dpnp/dpnp_iface_arraycreation.html

Lines changed: 4165 additions & 0 deletions
Large diffs are not rendered by default.

pull/2176/_modules/dpnp/dpnp_iface_bitwise.html

Lines changed: 709 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 227 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,227 @@
1+
2+
3+
<!DOCTYPE html>
4+
<html class="writer-html5" lang="en" data-content_root="../../">
5+
<head>
6+
<meta charset="utf-8" />
7+
<!-- Google tag (gtag.js) -->
8+
<script async src="https://www.googletagmanager.com/gtag/js?id=G-554F8VNE28"></script>
9+
<script>
10+
window.dataLayer = window.dataLayer || [];
11+
function gtag(){dataLayer.push(arguments);}
12+
gtag('js', new Date());
13+
gtag('config', 'G-554F8VNE28');
14+
</script>
15+
16+
<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+3.g25f98f77516 documentation</title>
18+
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
19+
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
20+
21+
22+
<script src="../../_static/jquery.js?v=5d32c60e"></script>
23+
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
24+
<script src="../../_static/documentation_options.js?v=b4080524"></script>
25+
<script src="../../_static/doctools.js?v=9bcbadda"></script>
26+
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
27+
<script src="../../_static/js/theme.js"></script>
28+
<link rel="index" title="Index" href="../../genindex.html" />
29+
<link rel="search" title="Search" href="../../search.html" />
30+
</head>
31+
32+
<body class="wy-body-for-nav">
33+
<div class="wy-grid-for-nav">
34+
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
35+
<div class="wy-side-scroll">
36+
<div class="wy-side-nav-search" >
37+
38+
39+
40+
<a href="../../index.html" class="icon icon-home">
41+
Data Parallel Extension for NumPy
42+
</a>
43+
<div role="search">
44+
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
45+
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
46+
<input type="hidden" name="check_keywords" value="yes" />
47+
<input type="hidden" name="area" value="default" />
48+
</form>
49+
</div>
50+
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
51+
<ul>
52+
<li class="toctree-l1"><a class="reference internal" href="../../overview.html">Overview</a></li>
53+
<li class="toctree-l1"><a class="reference internal" href="../../quick_start_guide.html">Quick Start Guide</a></li>
54+
<li class="toctree-l1"><a class="reference internal" href="../../reference/index.html">API Reference</a></li>
55+
</ul>
56+
<p class="caption" role="heading"><span class="caption-text">Development information</span></p>
57+
<ul>
58+
<li class="toctree-l1"><a class="reference internal" href="../../dpnp_backend_api.html">C++ backend API Reference</a></li>
59+
</ul>
60+
61+
</div>
62+
</div>
63+
</nav>
64+
65+
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
66+
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
67+
<a href="../../index.html">Data Parallel Extension for NumPy</a>
68+
</nav>
69+
70+
<div class="wy-nav-content">
71+
<div class="rst-content">
72+
<div role="navigation" aria-label="Page navigation">
73+
<ul class="wy-breadcrumbs">
74+
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
75+
<li class="breadcrumb-item"><a href="../index.html">Module code</a></li>
76+
<li class="breadcrumb-item active">dpnp.dpnp_iface_counting</li>
77+
<li class="wy-breadcrumbs-aside">
78+
</li>
79+
</ul>
80+
<hr/>
81+
</div>
82+
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
83+
<div itemprop="articleBody">
84+
85+
<h1>Source code for dpnp.dpnp_iface_counting</h1><div class="highlight"><pre>
86+
<span></span><span class="c1"># -*- coding: utf-8 -*-</span>
87+
<span class="c1"># *****************************************************************************</span>
88+
<span class="c1"># Copyright (c) 2016-2024, Intel Corporation</span>
89+
<span class="c1"># All rights reserved.</span>
90+
<span class="c1">#</span>
91+
<span class="c1"># Redistribution and use in source and binary forms, with or without</span>
92+
<span class="c1"># modification, are permitted provided that the following conditions are met:</span>
93+
<span class="c1"># - Redistributions of source code must retain the above copyright notice,</span>
94+
<span class="c1"># this list of conditions and the following disclaimer.</span>
95+
<span class="c1"># - Redistributions in binary form must reproduce the above copyright notice,</span>
96+
<span class="c1"># this list of conditions and the following disclaimer in the documentation</span>
97+
<span class="c1"># and/or other materials provided with the distribution.</span>
98+
<span class="c1">#</span>
99+
<span class="c1"># THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;</span>
100+
<span class="c1"># AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span>
101+
<span class="c1"># IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE</span>
102+
<span class="c1"># ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE</span>
103+
<span class="c1"># LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR</span>
104+
<span class="c1"># CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF</span>
105+
<span class="c1"># SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS</span>
106+
<span class="c1"># INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN</span>
107+
<span class="c1"># CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)</span>
108+
<span class="c1"># ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF</span>
109+
<span class="c1"># THE POSSIBILITY OF SUCH DAMAGE.</span>
110+
<span class="c1"># *****************************************************************************</span>
111+
112+
<span class="sd">&quot;&quot;&quot;</span>
113+
<span class="sd">Interface of the counting function of the dpnp</span>
114+
115+
<span class="sd">Notes</span>
116+
<span class="sd">-----</span>
117+
<span class="sd">This module is a face or public interface file for the library</span>
118+
<span class="sd">it contains:</span>
119+
<span class="sd"> - Interface functions</span>
120+
<span class="sd"> - documentation for the functions</span>
121+
<span class="sd"> - The functions parameters check</span>
122+
123+
<span class="sd">&quot;&quot;&quot;</span>
124+
125+
<span class="kn">import</span> <span class="nn">dpctl.tensor</span> <span class="k">as</span> <span class="nn">dpt</span>
126+
127+
<span class="kn">import</span> <span class="nn">dpnp</span>
128+
129+
<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;count_nonzero&quot;</span><span class="p">]</span>
130+
131+
132+
<div class="viewcode-block" id="count_nonzero">
133+
<a class="viewcode-back" href="../../reference/generated/dpnp.count_nonzero.html#dpnp.count_nonzero">[docs]</a>
134+
<span class="k">def</span> <span class="nf">count_nonzero</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">*</span><span class="p">,</span> <span class="n">keepdims</span><span class="o">=</span><span class="kc">False</span><span class="p">,</span> <span class="n">out</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
135+
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
136+
<span class="sd"> Counts the number of non-zero values in the array `a`.</span>
137+
138+
<span class="sd"> For full documentation refer to :obj:`numpy.count_nonzero`.</span>
139+
140+
<span class="sd"> Parameters</span>
141+
<span class="sd"> ----------</span>
142+
<span class="sd"> a : {dpnp.ndarray, usm_ndarray}</span>
143+
<span class="sd"> The array for which to count non-zeros.</span>
144+
<span class="sd"> axis : {None, int, tuple}, optional</span>
145+
<span class="sd"> Axis or tuple of axes along which to count non-zeros.</span>
146+
<span class="sd"> Default value means that non-zeros will be counted along a flattened</span>
147+
<span class="sd"> version of `a`.</span>
148+
<span class="sd"> Default: ``None``.</span>
149+
<span class="sd"> keepdims : bool, optional</span>
150+
<span class="sd"> If this is set to ``True``, the axes that are counted are left in the</span>
151+
<span class="sd"> result as dimensions with size one. With this option, the result will</span>
152+
<span class="sd"> broadcast correctly against the input array.</span>
153+
<span class="sd"> Default: ``False``.</span>
154+
<span class="sd"> out : {None, dpnp.ndarray, usm_ndarray}, optional</span>
155+
<span class="sd"> The array into which the result is written. The data type of `out` must</span>
156+
<span class="sd"> match the expected shape and the expected data type of the result.</span>
157+
<span class="sd"> If ``None`` then a new array is returned.</span>
158+
<span class="sd"> Default: ``None``.</span>
159+
160+
<span class="sd"> Returns</span>
161+
<span class="sd"> -------</span>
162+
<span class="sd"> out : dpnp.ndarray</span>
163+
<span class="sd"> Number of non-zero values in the array along a given axis.</span>
164+
<span class="sd"> Otherwise, a zero-dimensional array with the total number of non-zero</span>
165+
<span class="sd"> values in the array is returned.</span>
166+
167+
<span class="sd"> See Also</span>
168+
<span class="sd"> --------</span>
169+
<span class="sd"> :obj:`dpnp.nonzero` : Return the coordinates of all the non-zero values.</span>
170+
171+
<span class="sd"> Examples</span>
172+
<span class="sd"> --------</span>
173+
<span class="sd"> &gt;&gt;&gt; import dpnp as np</span>
174+
<span class="sd"> &gt;&gt;&gt; np.count_nonzero(np.eye(4))</span>
175+
<span class="sd"> array(4)</span>
176+
<span class="sd"> &gt;&gt;&gt; a = np.array([[0, 1, 7, 0],</span>
177+
<span class="sd"> [3, 0, 2, 19]])</span>
178+
<span class="sd"> &gt;&gt;&gt; np.count_nonzero(a)</span>
179+
<span class="sd"> array(5)</span>
180+
<span class="sd"> &gt;&gt;&gt; np.count_nonzero(a, axis=0)</span>
181+
<span class="sd"> array([1, 1, 2, 1])</span>
182+
<span class="sd"> &gt;&gt;&gt; np.count_nonzero(a, axis=1)</span>
183+
<span class="sd"> array([2, 3])</span>
184+
<span class="sd"> &gt;&gt;&gt; np.count_nonzero(a, axis=1, keepdims=True)</span>
185+
<span class="sd"> array([[2],</span>
186+
<span class="sd"> [3]])</span>
187+
188+
<span class="sd"> &quot;&quot;&quot;</span>
189+
190+
<span class="n">usm_a</span> <span class="o">=</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">get_usm_ndarray</span><span class="p">(</span><span class="n">a</span><span class="p">)</span>
191+
<span class="n">usm_out</span> <span class="o">=</span> <span class="kc">None</span> <span class="k">if</span> <span class="n">out</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">get_usm_ndarray</span><span class="p">(</span><span class="n">out</span><span class="p">)</span>
192+
193+
<span class="n">usm_res</span> <span class="o">=</span> <span class="n">dpt</span><span class="o">.</span><span class="n">count_nonzero</span><span class="p">(</span>
194+
<span class="n">usm_a</span><span class="p">,</span> <span class="n">axis</span><span class="o">=</span><span class="n">axis</span><span class="p">,</span> <span class="n">keepdims</span><span class="o">=</span><span class="n">keepdims</span><span class="p">,</span> <span class="n">out</span><span class="o">=</span><span class="n">usm_out</span>
195+
<span class="p">)</span>
196+
<span class="k">return</span> <span class="n">dpnp</span><span class="o">.</span><span class="n">get_result_array</span><span class="p">(</span><span class="n">usm_res</span><span class="p">,</span> <span class="n">out</span><span class="p">)</span></div>
197+
198+
</pre></div>
199+
200+
</div>
201+
</div>
202+
<footer>
203+
204+
<hr/>
205+
206+
<div role="contentinfo">
207+
<p>&#169; Copyright 2020-2024, Intel Corporation.</p>
208+
</div>
209+
210+
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
211+
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
212+
provided by <a href="https://readthedocs.org">Read the Docs</a>.
213+
214+
215+
</footer>
216+
</div>
217+
</div>
218+
</section>
219+
</div>
220+
<script>
221+
jQuery(function () {
222+
SphinxRtdTheme.Navigation.enable(true);
223+
});
224+
</script>
225+
226+
</body>
227+
</html>

0 commit comments

Comments
 (0)