-2
What is assert(false)
doing in the following code?Java的斷言(假)
public float[] evaluate(float[] inputs)
{
// propagate the inputs through all neural network
// and return the outputs
assert(false);
float outputs[] = new float[inputs.length];
for(int i = 0; i < _layers.size(); ++i) {
outputs = _layers.get(i).evaluate(inputs);
inputs = outputs;
}
return outputs;
}
另請參閱http://stackoverflow.com/questions/28480068/assertfalse-vs-runtimeexception和http://stackoverflow.com/questions/36468020/is-assert-false-a-good-practice – Tunaki