viz.analysis.computeMinMax
function computeMinMax(tensor: Tensor): Promise<{ min: number; max: number }>Compute just min and max values (for performance when other stats not needed).
Returns only min and max by calling computeStats and extracting those values. Faster than computeStats if you only need the extremes. Useful for checking if values are within expected range or detecting overflow/underflow.
Parameters
tensorTensor- Input tensor on WebGPU device
Returns
Promise<{ min: number; max: number }>– Promise resolving to object with: - min: Minimum value - max: Maximum valueExamples
const {min, max} = await computeMinMax(weights);
if (max > 1000 || min < -1000) console.warn('Weights exploding!');See Also
- computeStats - For full statistics (mean, std, sum)