function assert(expr, msg) {
	  if (!expr) {
	    throw new Error(typeof msg === 'string' ? msg : msg());
	  }
	}
Asserts that the expression is true. Otherwise throws an error with the
provided message.

```js
const x = 2;
tf.util.assert(x === 2, 'x is not 2');
```

@param expr The expression to assert (as a boolean).
@param msg A function that returns the message to report when throwing an
    error. We use a function for performance reasons.

@doc {heading: 'Util', namespace: 'util'}