MCPcopy Index your code
hub / github.com/tensorflow/tfjs / min

Function min

tfjs-layers/src/utils/math_utils.ts:61–74  ·  view source on GitHub ↗
(array: number[]|Float32Array)

Source from the content-addressed store, hash-verified

59 * @return minimum value.
60 */
61export function min(array: number[]|Float32Array): number {
62 // same behavior as tf.min()
63 if (array.length === 0) {
64 return Number.NaN;
65 }
66 let min = Number.POSITIVE_INFINITY;
67 for (let i = 0; i < array.length; i++) {
68 const value = array[i];
69 if (value < min) {
70 min = value;
71 }
72 }
73 return min;
74}
75
76/**
77 * Compute maximum value.

Callers 4

computeDatasetStatisticsFunction · 0.50
callMethod · 0.50
min.tsFile · 0.50
normImplFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected