(shape: Shape)
| 21 | |
| 22 | /** Compute total element count based on shape. */ |
| 23 | export 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. |
no outgoing calls
no test coverage detected
searching dependent graphs…