Skip to content

Commit 9243274

Browse files
Add implementation of dpnp.ndarray.tofile method c8bf178
1 parent 3788c7a commit 9243274

File tree

779 files changed

+7000
-5837
lines changed

Some content is hidden

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

779 files changed

+7000
-5837
lines changed

pull/2653/.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: 2226668858f168ce77d51a883ea0b179
3+
config: 087adf501f7f33ce15a66fb7b69ba8d3
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

pull/2653/_modules/dpnp/dpnp_array.html

Lines changed: 49 additions & 3 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.20.0dev0+29.gc1b7434f344 documentation</title>
17+
<title>dpnp.dpnp_array &mdash; Data Parallel Extension for NumPy 0.20.0dev0+33.gc8bf1783ccb documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
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=e598d6b9"></script>
24+
<script src="../../_static/documentation_options.js?v=8e353a0c"></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>
@@ -2252,7 +2252,53 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
22522252
<span class="bp">self</span><span class="o">.</span><span class="n">asnumpy</span><span class="p">()</span><span class="o">.</span><span class="n">tofile</span><span class="p">(</span><span class="n">fid</span><span class="p">,</span> <span class="n">sep</span><span class="o">=</span><span class="n">sep</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="nb">format</span><span class="p">)</span></div>
22532253

22542254

2255-
<span class="c1"># &#39;tolist&#39;,</span>
2255+
<div class="viewcode-block" id="dpnp_array.tolist">
2256+
<a class="viewcode-back" href="../../reference/generated/dpnp.dpnp_array.dpnp_array.tolist.html#dpnp.dpnp_array.dpnp_array.tolist">[docs]</a>
2257+
<span class="k">def</span><span class="w"> </span><span class="nf">tolist</span><span class="p">(</span><span class="bp">self</span><span class="p">):</span>
2258+
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
2259+
<span class="sd"> Converts the array to a (possibly nested) Python list.</span>
2260+
2261+
<span class="sd"> For full documentation refer to :obj:`numpy.ndarray.tolist`.</span>
2262+
2263+
<span class="sd"> Returns</span>
2264+
<span class="sd"> -------</span>
2265+
<span class="sd"> out : list</span>
2266+
<span class="sd"> The possibly nested Python list of array elements.</span>
2267+
2268+
<span class="sd"> Examples</span>
2269+
<span class="sd"> --------</span>
2270+
<span class="sd"> For a 1D array, ``a.tolist()`` is almost the same as ``list(a)``,</span>
2271+
<span class="sd"> except that ``tolist`` changes 0D arrays to Python scalars:</span>
2272+
2273+
<span class="sd"> &gt;&gt;&gt; import dpnp as np</span>
2274+
<span class="sd"> &gt;&gt;&gt; a = np.array([1, 2])</span>
2275+
<span class="sd"> &gt;&gt;&gt; list(a)</span>
2276+
<span class="sd"> [array(1), array(2)]</span>
2277+
<span class="sd"> &gt;&gt;&gt; a.tolist()</span>
2278+
<span class="sd"> [1, 2]</span>
2279+
2280+
<span class="sd"> Additionally, for a 2D array, ``tolist`` applies recursively:</span>
2281+
2282+
<span class="sd"> &gt;&gt;&gt; a = np.array([[1, 2], [3, 4]])</span>
2283+
<span class="sd"> &gt;&gt;&gt; list(a)</span>
2284+
<span class="sd"> [array([1, 2]), array([3, 4])]</span>
2285+
<span class="sd"> &gt;&gt;&gt; a.tolist()</span>
2286+
<span class="sd"> [[1, 2], [3, 4]]</span>
2287+
2288+
<span class="sd"> The base case for this recursion is a 0D array:</span>
2289+
2290+
<span class="sd"> &gt;&gt;&gt; a = np.array(1)</span>
2291+
<span class="sd"> &gt;&gt;&gt; list(a)</span>
2292+
<span class="sd"> Traceback (most recent call last):</span>
2293+
<span class="sd"> ...</span>
2294+
<span class="sd"> TypeError: iteration over a 0-d array</span>
2295+
<span class="sd"> &gt;&gt;&gt; a.tolist()</span>
2296+
<span class="sd"> 1</span>
2297+
2298+
<span class="sd"> &quot;&quot;&quot;</span>
2299+
2300+
<span class="k">return</span> <span class="bp">self</span><span class="o">.</span><span class="n">asnumpy</span><span class="p">()</span><span class="o">.</span><span class="n">tolist</span><span class="p">()</span></div>
2301+
22562302

22572303
<div class="viewcode-block" id="dpnp_array.trace">
22582304
<a class="viewcode-back" href="../../reference/generated/dpnp.dpnp_array.dpnp_array.trace.html#dpnp.dpnp_array.dpnp_array.trace">[docs]</a>

pull/2653/_modules/dpnp/dpnp_array_api_info.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_api_info &mdash; Data Parallel Extension for NumPy 0.20.0dev0+29.gc1b7434f344 documentation</title>
17+
<title>dpnp.dpnp_array_api_info &mdash; Data Parallel Extension for NumPy 0.20.0dev0+33.gc8bf1783ccb documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
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=e598d6b9"></script>
24+
<script src="../../_static/documentation_options.js?v=8e353a0c"></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/2653/_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.20.0dev0+29.gc1b7434f344 documentation</title>
17+
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.20.0dev0+33.gc8bf1783ccb documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
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=e598d6b9"></script>
24+
<script src="../../_static/documentation_options.js?v=8e353a0c"></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/2653/_modules/dpnp/dpnp_iface.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 &mdash; Data Parallel Extension for NumPy 0.20.0dev0+29.gc1b7434f344 documentation</title>
17+
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.20.0dev0+33.gc8bf1783ccb documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
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=e598d6b9"></script>
24+
<script src="../../_static/documentation_options.js?v=8e353a0c"></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/2653/_modules/dpnp/dpnp_iface_arraycreation.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_arraycreation &mdash; Data Parallel Extension for NumPy 0.20.0dev0+29.gc1b7434f344 documentation</title>
17+
<title>dpnp.dpnp_iface_arraycreation &mdash; Data Parallel Extension for NumPy 0.20.0dev0+33.gc8bf1783ccb documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
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=e598d6b9"></script>
24+
<script src="../../_static/documentation_options.js?v=8e353a0c"></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/2653/_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.20.0dev0+29.gc1b7434f344 documentation</title>
17+
<title>dpnp.dpnp_iface_bitwise &mdash; Data Parallel Extension for NumPy 0.20.0dev0+33.gc8bf1783ccb documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
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=e598d6b9"></script>
24+
<script src="../../_static/documentation_options.js?v=8e353a0c"></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/2653/_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.20.0dev0+29.gc1b7434f344 documentation</title>
17+
<title>dpnp.dpnp_iface_counting &mdash; Data Parallel Extension for NumPy 0.20.0dev0+33.gc8bf1783ccb documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
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=e598d6b9"></script>
24+
<script src="../../_static/documentation_options.js?v=8e353a0c"></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/2653/_modules/dpnp/dpnp_iface_functional.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_functional &mdash; Data Parallel Extension for NumPy 0.20.0dev0+29.gc1b7434f344 documentation</title>
17+
<title>dpnp.dpnp_iface_functional &mdash; Data Parallel Extension for NumPy 0.20.0dev0+33.gc8bf1783ccb documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
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=e598d6b9"></script>
24+
<script src="../../_static/documentation_options.js?v=8e353a0c"></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/2653/_modules/dpnp/dpnp_iface_histograms.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_histograms &mdash; Data Parallel Extension for NumPy 0.20.0dev0+29.gc1b7434f344 documentation</title>
17+
<title>dpnp.dpnp_iface_histograms &mdash; Data Parallel Extension for NumPy 0.20.0dev0+33.gc8bf1783ccb documentation</title>
1818
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=03e43079" />
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=e598d6b9"></script>
24+
<script src="../../_static/documentation_options.js?v=8e353a0c"></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)