MCPcopy
hub / github.com/tensorflow/tfjs / assert

Function assert

tfjs-core/src/util_base.ts:151–155  ·  view source on GitHub ↗
(expr: boolean, msg: () => string)

Source from the content-addressed store, hash-verified

149 * @doc {heading: 'Util', namespace: 'util'}
150 */
151export function assert(expr: boolean, msg: () => string) {
152 if (!expr) {
153 throw new Error(typeof msg === 'string' ? msg : msg());
154 }
155}
156
157export function assertShapesMatch(
158 shapeA: number[], shapeB: number[], errorMessagePrefix = ''): void {

Callers 15

registerClassFunction · 0.90
assertTypesMatchFunction · 0.90
as_scalar.tsFile · 0.90
prepareSplitSizeFunction · 0.90
unsortedSegmentSum_Function · 0.90
pad3d_Function · 0.90
unique_Function · 0.90
pad4d_Function · 0.90
makeTensorFunction · 0.90
concat_Function · 0.90
pad1d_Function · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…