You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<li><p><strong>device</strong> (Optional[str, <aclass="reference internal" href="dpctl.SyclDevice.html#dpctl.SyclDevice" title="dpctl.SyclDevice"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.SyclDevice</span></code></a>, <aclass="reference internal" href="dpctl.SyclQueue.html#dpctl.SyclQueue" title="dpctl.SyclQueue"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.SyclQueue</span></code></a>, <aclass="reference internal" href="../tensor.utility_functions.html#dpctl.tensor.Device" title="dpctl.tensor.Device"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.tensor.Device</span></code></a>, tuple([<aclass="reference external" href="https://docs.python.org/3/library/enum.html#enum.IntEnum" title="(in Python v3.13)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">enum.IntEnum</span></code></a>, int])])) – <p>Device where the output array is to be placed. <codeclass="docutils literal notranslate"><spanclass="pre">device</span></code> keyword values can be:</p>
832
832
<ul>
833
833
<li><dlclass="simple">
834
-
<dt><codeclass="docutils literal notranslate"><spanclass="pre">None</span></code></dt><dd><p>The data remains on the same device. If the data backing up
835
-
input object <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> resides on <codeclass="docutils literal notranslate"><spanclass="pre">"kDLCPU"</span></code> device, the return
836
-
type would be <aclass="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.1)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">numpy.ndarray</span></code></a>, otherwise the return
837
-
type would be <aclass="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.tensor.usm_ndarray</span></code></a>.</p>
834
+
<dt><codeclass="docutils literal notranslate"><spanclass="pre">None</span></code></dt><dd><p>The data remains on the same device.</p>
method: an integer enumerator representing the device type followed by
866
863
an integer representing the index of the device.
867
864
The only supported <aclass="reference internal" href="../tensor.constants.html#dpctl.tensor.DLDeviceType" title="dpctl.tensor.DLDeviceType"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.tensor.DLDeviceType</span></code></a> device types
868
-
are <codeclass="docutils literal notranslate"><spanclass="pre">"kDLCPU"</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">"kDLOneAPI"</span></code>. If <codeclass="docutils literal notranslate"><spanclass="pre">"kDLCPU"</span></code> requested, the
869
-
output type is <aclass="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.1)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">numpy.ndarray</span></code></a>, otherwise it is
are <codeclass="docutils literal notranslate"><spanclass="pre">"kDLCPU"</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">"kDLOneAPI"</span></code>.</p>
<p>If the return type if <aclass="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.tensor.usm_ndarray</span></code></a>, the associated
879
-
SYCL queue is derived from the <codeclass="docutils literal notranslate"><spanclass="pre">device</span></code> keyword. When <codeclass="docutils literal notranslate"><spanclass="pre">device</span></code>
880
-
keyword value has type <aclass="reference internal" href="dpctl.SyclQueue.html#dpctl.SyclQueue" title="dpctl.SyclQueue"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.SyclQueue</span></code></a>, the explicit queue
881
-
instance is used, when <codeclass="docutils literal notranslate"><spanclass="pre">device</span></code> keyword value has type <aclass="reference internal" href="../tensor.utility_functions.html#dpctl.tensor.Device" title="dpctl.tensor.Device"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.tensor.Device</span></code></a>,
882
-
the <codeclass="docutils literal notranslate"><spanclass="pre">device.sycl_queue</span></code> is used. In all other cases, the cached
883
-
SYCL queue corresponding the implied SYCL device is used.</p>
884
-
</div>
885
871
</p></li>
886
872
<li><p><strong>copy</strong> (<aclass="reference external" href="https://docs.python.org/3/library/functions.html#bool" title="(in Python v3.13)"><em>bool</em></a><em>, </em><em>optional</em>) – <p>Boolean indicating whether or not to copy the input.</p>
<ddclass="field-even"><p>An array containing the data in <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>. When <codeclass="docutils literal notranslate"><spanclass="pre">copy</span></code> is
887
+
<ddclass="field-even"><p><p>An array containing the data in <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>. When <codeclass="docutils literal notranslate"><spanclass="pre">copy</span></code> is
902
888
<codeclass="docutils literal notranslate"><spanclass="pre">None</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>, this may be a view into the original
903
889
memory.</p>
890
+
<p>The type of the returned object
891
+
depends on where the data backing up input object <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> resides.
892
+
If it resides in a USM allocation on a SYCL device, the
893
+
type <aclass="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.tensor.usm_ndarray</span></code></a> is returned, otherwise if it resides
894
+
on <codeclass="docutils literal notranslate"><spanclass="pre">"kDLCPU"</span></code> device the type is <aclass="reference external" href="https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray" title="(in NumPy v2.1)"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">numpy.ndarray</span></code></a>, and otherwise
895
+
an exception is raised.</p>
896
+
<divclass="admonition note">
897
+
<pclass="admonition-title">Note</p>
898
+
<p>If the return type is <aclass="reference internal" href="dpctl.tensor.usm_ndarray.html#dpctl.tensor.usm_ndarray" title="dpctl.tensor.usm_ndarray"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.tensor.usm_ndarray</span></code></a>, the associated
899
+
SYCL queue is derived from the <codeclass="docutils literal notranslate"><spanclass="pre">device</span></code> keyword. When <codeclass="docutils literal notranslate"><spanclass="pre">device</span></code>
900
+
keyword value has type <aclass="reference internal" href="dpctl.SyclQueue.html#dpctl.SyclQueue" title="dpctl.SyclQueue"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.SyclQueue</span></code></a>, the explicit queue
901
+
instance is used, when <codeclass="docutils literal notranslate"><spanclass="pre">device</span></code> keyword value has type <aclass="reference internal" href="../tensor.utility_functions.html#dpctl.tensor.Device" title="dpctl.tensor.Device"><codeclass="xref py py-class docutils literal notranslate"><spanclass="pre">dpctl.tensor.Device</span></code></a>,
902
+
the <codeclass="docutils literal notranslate"><spanclass="pre">device.sycl_queue</span></code> is used. In all other cases, the cached
903
+
SYCL queue corresponding to the implied SYCL device is used.</p>
0 commit comments