Skip to content

Commit b3bca7f

Browse files
Add implementation of dpnp.ndarray.tofile method (#2653)
The PR adds implementation of `dpnp.ndarray.tofile` method converting the array to `numpy.ndarray` and calling `.tofile(...)` for the result. 03e0975
1 parent 67f5db2 commit b3bca7f

File tree

754 files changed

+1936
-1510
lines changed

Some content is hidden

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

754 files changed

+1936
-1510
lines changed

.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: 1b4e92ff3d0135a9cad6f28ac88e63bd
3+
config: dc8ca1c580354280f46d23e435249a67
44
tags: 645f666f9bcd5a90fca523b33c5a78b7

_modules/dpnp/dpnp_array.html

Lines changed: 38 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+31.gb7d1572b2b3 documentation</title>
17+
<title>dpnp.dpnp_array &mdash; Data Parallel Extension for NumPy 0.20.0dev0+32.g03e09752002 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=9a371350"></script>
24+
<script src="../../_static/documentation_options.js?v=0cb249ce"></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>
@@ -2220,7 +2220,42 @@ <h1>Source code for dpnp.dpnp_array</h1><div class="highlight"><pre>
22202220

22212221

22222222
<span class="c1"># &#39;tobytes&#39;,</span>
2223-
<span class="c1"># &#39;tofile&#39;,</span>
2223+
2224+
<div class="viewcode-block" id="dpnp_array.tofile">
2225+
<a class="viewcode-back" href="../../reference/generated/dpnp.dpnp_array.dpnp_array.tofile.html#dpnp.dpnp_array.dpnp_array.tofile">[docs]</a>
2226+
<span class="k">def</span><span class="w"> </span><span class="nf">tofile</span><span class="p">(</span><span class="bp">self</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="s2">&quot;&quot;</span><span class="p">,</span> <span class="nb">format</span><span class="o">=</span><span class="s2">&quot;&quot;</span><span class="p">):</span>
2227+
<span class="w"> </span><span class="sd">&quot;&quot;&quot;</span>
2228+
<span class="sd"> Writes the array to a file as text or binary (default).</span>
2229+
2230+
<span class="sd"> For full documentation refer to :obj:`numpy.ndarray.tofile`.</span>
2231+
2232+
<span class="sd"> Parameters</span>
2233+
<span class="sd"> ----------</span>
2234+
<span class="sd"> fid : {file. str, path}</span>
2235+
<span class="sd"> An open file object, or a string containing a filename.</span>
2236+
<span class="sd"> sep : str, optional</span>
2237+
<span class="sd"> Separator between array items for text output. If ``&quot;&quot;`` (empty),</span>
2238+
<span class="sd"> a binary file is written.</span>
2239+
2240+
<span class="sd"> Default: ``&quot;&quot;``.</span>
2241+
<span class="sd"> format : str, optional</span>
2242+
<span class="sd"> Format string for text file output (when non-empty `sep` is passed).</span>
2243+
<span class="sd"> Each entry in the array is formatted to text by first converting it</span>
2244+
<span class="sd"> to the closest Python type, and then using ``format % item``. If</span>
2245+
<span class="sd"> ``&quot;&quot;`` (empty), no formatting is used while converting to the</span>
2246+
<span class="sd"> string.</span>
2247+
2248+
<span class="sd"> Default: ``&quot;&quot;``.</span>
2249+
2250+
<span class="sd"> See Also</span>
2251+
<span class="sd"> --------</span>
2252+
<span class="sd"> :obj:`dpnp.fromfile` : Construct an array from data in a text or binary</span>
2253+
<span class="sd"> file.</span>
2254+
2255+
<span class="sd"> &quot;&quot;&quot;</span>
2256+
2257+
<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>
2258+
22242259

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

_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+31.gb7d1572b2b3 documentation</title>
17+
<title>dpnp.dpnp_array_api_info &mdash; Data Parallel Extension for NumPy 0.20.0dev0+32.g03e09752002 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=9a371350"></script>
24+
<script src="../../_static/documentation_options.js?v=0cb249ce"></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>

_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+31.gb7d1572b2b3 documentation</title>
17+
<title>dpnp.dpnp_flatiter &mdash; Data Parallel Extension for NumPy 0.20.0dev0+32.g03e09752002 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=9a371350"></script>
24+
<script src="../../_static/documentation_options.js?v=0cb249ce"></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>

_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+31.gb7d1572b2b3 documentation</title>
17+
<title>dpnp.dpnp_iface &mdash; Data Parallel Extension for NumPy 0.20.0dev0+32.g03e09752002 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=9a371350"></script>
24+
<script src="../../_static/documentation_options.js?v=0cb249ce"></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>

_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+31.gb7d1572b2b3 documentation</title>
17+
<title>dpnp.dpnp_iface_arraycreation &mdash; Data Parallel Extension for NumPy 0.20.0dev0+32.g03e09752002 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=9a371350"></script>
24+
<script src="../../_static/documentation_options.js?v=0cb249ce"></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>

_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+31.gb7d1572b2b3 documentation</title>
17+
<title>dpnp.dpnp_iface_bitwise &mdash; Data Parallel Extension for NumPy 0.20.0dev0+32.g03e09752002 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=9a371350"></script>
24+
<script src="../../_static/documentation_options.js?v=0cb249ce"></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>

_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+31.gb7d1572b2b3 documentation</title>
17+
<title>dpnp.dpnp_iface_counting &mdash; Data Parallel Extension for NumPy 0.20.0dev0+32.g03e09752002 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=9a371350"></script>
24+
<script src="../../_static/documentation_options.js?v=0cb249ce"></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>

_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+31.gb7d1572b2b3 documentation</title>
17+
<title>dpnp.dpnp_iface_functional &mdash; Data Parallel Extension for NumPy 0.20.0dev0+32.g03e09752002 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=9a371350"></script>
24+
<script src="../../_static/documentation_options.js?v=0cb249ce"></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>

_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+31.gb7d1572b2b3 documentation</title>
17+
<title>dpnp.dpnp_iface_histograms &mdash; Data Parallel Extension for NumPy 0.20.0dev0+32.g03e09752002 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=9a371350"></script>
24+
<script src="../../_static/documentation_options.js?v=0cb249ce"></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)