nonzero function

(VARP, VARP?) nonzero(
  1. VARP x
)

Implementation

(VARP, VARP?) nonzero(VARP x) {
  final res = F.where(x);
  if (x.ndim == 1) {
    return (res, null);
  }
  final splitted = split(x, [2]);
  return (ravel(splitted[0]), ravel(splitted[1]));
}