Function arrayfire::replace_scalar [] [src]

pub fn replace_scalar(a: &mut Array, cond: &Array, b: f64)

Inplace replace in Array based on a condition

This function does the C-equivalent of the following statement, except that the operation happens on a GPU for all elements simultaneously.

a = cond ? a : b; /// where cond, a are Arrays and b is scalar(f64)

Parameters

  • a is the Array whose element will be replaced with element from b if corresponding element in cond Array is True
  • cond is the Array with conditional values
  • b is the scalar that will replace the element in output if corresponding element in cond Array is False

Return Values

None