-2

What is assert(false) doing in the following code?

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;
}
1

1 Answer 1

1

The line, as it is, only checks that asserations are not enabled, otherwise throw an AsserationError. As you can add an message like

assert false: "nope!";

there is no equivalent in c#. Also it is in java a keyword but not in c#.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.