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

Function assertShapesMatch

tfjs-vis/src/util/utils.ts:29–34  ·  view source on GitHub ↗
(
    shapeA: number[], shapeB: number[], errorMessagePrefix = '')

Source from the content-addressed store, hash-verified

27}
28
29export function assertShapesMatch(
30 shapeA: number[], shapeB: number[], errorMessagePrefix = ''): void {
31 assert(
32 arraysEqual(shapeA, shapeB),
33 errorMessagePrefix + ` Shapes ${shapeA} and ${shapeB} must match`);
34}
35
36export function arraysEqual(n1: number[]|TypedArray, n2: number[]|TypedArray) {
37 if (n1.length !== n2.length) {

Callers 1

accuracyFunction · 0.90

Calls 2

assertFunction · 0.70
arraysEqualFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…