Asserts that the expression is true. Otherwise throws an error with the provided message.
const x = 2;tf.util.assert(x === 2, 'x is not 2'); Copy
const x = 2;tf.util.assert(x === 2, 'x is not 2');
The expression to assert (as a boolean).
A function that returns the message to report when throwing an error. We use a function for performance reasons.
Generated using TypeDoc
Asserts that the expression is true. Otherwise throws an error with the provided message.