|
62 | 62 | "check_limitations",
|
63 | 63 | "check_supported_arrays_type",
|
64 | 64 | "default_float_type",
|
65 |
| - "from_dlpack", |
66 | 65 | "get_dpnp_descriptor",
|
67 | 66 | "get_include",
|
68 | 67 | "get_normalized_queue_device",
|
@@ -443,60 +442,6 @@ def default_float_type(device=None, sycl_queue=None):
|
443 | 442 | return map_dtype_to_device(float64, _sycl_queue.sycl_device)
|
444 | 443 |
|
445 | 444 |
|
446 |
| -def from_dlpack(obj, /, *, device=None, copy=None): |
447 |
| - """ |
448 |
| - Create a dpnp array from a Python object implementing the ``__dlpack__`` |
449 |
| - protocol. |
450 |
| -
|
451 |
| - See https://dmlc.github.io/dlpack/latest/ for more details. |
452 |
| -
|
453 |
| - Parameters |
454 |
| - ---------- |
455 |
| - obj : object |
456 |
| - A Python object representing an array that implements the ``__dlpack__`` |
457 |
| - and ``__dlpack_device__`` methods. |
458 |
| - device : {:class:`dpctl.SyclDevice`, :class:`dpctl.SyclQueue`, |
459 |
| - :class:`dpctl.tensor.Device`, tuple, None}, optional |
460 |
| - Array API concept of a device where the output array is to be placed. |
461 |
| - ``device`` can be ``None``, an oneAPI filter selector string, |
462 |
| - an instance of :class:`dpctl.SyclDevice` corresponding to |
463 |
| - a non-partitioned SYCL device, an instance of :class:`dpctl.SyclQueue`, |
464 |
| - a :class:`dpctl.tensor.Device` object returned by |
465 |
| - :attr:`dpctl.tensor.usm_ndarray.device`, or a 2-tuple matching |
466 |
| - the format of the output of the ``__dlpack_device__`` method, |
467 |
| - an integer enumerator representing the device type followed by |
468 |
| - an integer representing the index of the device. |
469 |
| - Default: ``None``. |
470 |
| - copy {bool, None}, optional |
471 |
| - Boolean indicating whether or not to copy the input. |
472 |
| -
|
473 |
| - * If `copy``is ``True``, the input will always be copied. |
474 |
| - * If ``False``, a ``BufferError`` will be raised if a copy is deemed |
475 |
| - necessary. |
476 |
| - * If ``None``, a copy will be made only if deemed necessary, otherwise, |
477 |
| - the existing memory buffer will be reused. |
478 |
| -
|
479 |
| - Default: ``None``. |
480 |
| -
|
481 |
| - Returns |
482 |
| - ------- |
483 |
| - out : dpnp_array |
484 |
| - Returns a new dpnp array containing the data from another array |
485 |
| - (obj) with the ``__dlpack__`` method on the same device as object. |
486 |
| -
|
487 |
| - Raises |
488 |
| - ------ |
489 |
| - TypeError: |
490 |
| - if `obj` does not implement ``__dlpack__`` method |
491 |
| - ValueError: |
492 |
| - if the input array resides on an unsupported device |
493 |
| -
|
494 |
| - """ |
495 |
| - |
496 |
| - usm_res = dpt.from_dlpack(obj, device=device, copy=copy) |
497 |
| - return dpnp_array._create_from_usm_ndarray(usm_res) |
498 |
| - |
499 |
| - |
500 | 445 | def get_dpnp_descriptor(
|
501 | 446 | ext_obj,
|
502 | 447 | copy_when_strides=True,
|
|
0 commit comments