MCPcopy Create free account
hub / github.com/tensorflow/tensorboard / numElements

Function numElements

tensorboard/components/tensor_widget/shape-utils.ts:23–29  ·  view source on GitHub ↗
(shape: Shape)

Source from the content-addressed store, hash-verified

21
22/** Compute total element count based on shape. */
23export function numElements(shape: Shape): number {
24 let output = 1;
25 shape.forEach((dimSize) => {
26 output *= dimSize;
27 });
28 return output;
29}
30
31/**
32 * Format tensor shape as a string for display.

Callers 2

constructorMethod · 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…