You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

WhereLink.py 459 B

5 years ago
1234567891011121314
  1. from __future__ import absolute_import
  2. import ctypes
  3. from .._base import _LIB
  4. from .. import ndarray as _nd
  5. def where(cond, arr1, arr2, out_arr, stream=None):
  6. assert isinstance(cond, _nd.NDArray)
  7. assert isinstance(arr1, _nd.NDArray)
  8. assert isinstance(arr2, _nd.NDArray)
  9. assert isinstance(out_arr, _nd.NDArray)
  10. _LIB.DLGpuWhere(cond.handle, arr1.handle, arr2.handle,
  11. out_arr.handle, stream.handle if stream else None)