Utility functions

all

Tests whether all input array elements evaluate to True along a given axis.

any

Tests whether any input array elements evaluate to True along a given axis.

allclose

Returns True if two arrays are element-wise equal within tolerances.

diff

Calculates the n-th discrete forward difference of x along axis.

asnumpy

Copies content of dpnp.tensor.usm_ndarray instance usm_ary into numpy.ndarray instance of the same shape and same data type.

to_numpy

Copies content of dpnp.tensor.usm_ndarray instance usm_ary into numpy.ndarray instance of the same shape and same data type.

Device object

class dpnp.tensor.Device(*args, **kwargs)[source]

An object representing Data-API concept of device.

This is a wrapper around dpctl.SyclQueue with custom formatting. The class does not have public constructor, but a class method dpnp.tensor.Device.create_device() to construct it from device keyword argument in Array-API functions.

Instance can be queried for sycl_queue, sycl_context, or sycl_device.

create_device([device])

Creates instance of Device from argument.

sycl_queue

dpctl.SyclQueue used to offload to this Device.

sycl_device

dpctl.SyclDevice targeted by this Device.

sycl_context

dpctl.SyclContext associated with this Device.

print_device_info()

Outputs information about targeted SYCL device

wait()

Call wait method of the underlying sycl_queue.