viz.analysis.describeStats
function describeStats(stats: TensorStats): stringGenerate human-readable description of tensor statistics.
Converts TensorStats object to string with rounded values. Useful for logging, debugging, and accessibility (e.g., alt text for plots). Values are rounded to 4 significant figures using toPrecision().
Parameters
statsTensorStats- Statistics object from computeStats()
Returns
string– String like "Tensor with 1048576 elements: min=-0.0523, max=0.0891, mean=-0.002, std=0.0415"Examples
const stats = await computeStats(weights);
console.log(describeStats(stats)); // Log human-readable stats
element.title = describeStats(stats); // Alt text for accessibilitySee Also
- computeStats - For computing statistics first