def test_vector_is_valid(): rn = CudaFn(5) weight = _pos_vector(rn) weighting = CudaFnVectorWeighting(weight) assert weighting.is_valid() # Invalid weight[0] = 0 weighting = CudaFnVectorWeighting(weight) assert not weighting.is_valid()