cupy.asarray_chkfinite#

cupy.asarray_chkfinite(a, dtype=None, order=None)[source]#

Converts the given input to an array, and raises an error if the input contains NaNs or Infs.

Parameters
  • a – array like.

  • dtype – data type, optional

  • order – {‘C’, ‘F’, ‘A’, ‘K’}, optional

Returns

An array on the current device.

Return type

cupy.ndarray

Note

This function performs device synchronization.