code: def _validate_weights(w, dtype="float64"):
      w = _validate_vector(w, dtype=dtype)
      if ivy.any(w < 0):
          raise ValueError("Input weights should be all non-negative")
      return w
  
imports: import ivy
  from ivy.functional.frontends.numpy.func_wrapper import to_ivy_arrays_and_back
  import ivy.functional.frontends.scipy
label_desc: Use image node_id 2 for calling a global function with example usage: _validate_weights(w, dtype) and returns: w