A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://arrayfire.org/arrayfire-python/arrayfire.interop.html below:

arrayfire.interop module — ArrayFire Python documentation

arrayfire.interop module

Interop with other python packages.

This module provides helper functions to copy data to arrayfire from the following modules:

  1. numpy - numpy.ndarray

  2. pycuda - pycuda.gpuarray

  3. pyopencl - pyopencl.array

  4. numba - numba.cuda.cudadrv.devicearray.DeviceNDArray

arrayfire.interop.from_ndarray(np_arr, copy=True)

Convert numpy.ndarray to arrayfire.Array.

Parameters
np_arrnumpy.ndarray()
copyBool specifying if array is to be copied.

Default is true. Can only be False if array is fortran contiguous.

Returns
af_arrarrayfire.Array()
arrayfire.interop.np_to_af_array(np_arr, copy=True)[source]

Convert numpy.ndarray to arrayfire.Array.

Parameters
np_arrnumpy.ndarray()
copyBool specifying if array is to be copied.

Default is true. Can only be False if array is fortran contiguous.

Returns
af_arrarrayfire.Array()
arrayfire.interop.to_array(in_array, copy=True)[source]

Helper function to convert input from a different module to af.Array

Parameters
in_arrayarray like object

Can be one of the following: - numpy.ndarray - pycuda.GPUArray - pyopencl.Array - numba.cuda.cudadrv.devicearray.DeviceNDArray - array.array - list

copyBool specifying if array is to be copied.

Default is true. Can only be False if array is fortran contiguous.

Returns
af.Array of same dimensions as input after copying the data from the input

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4