MCPcopy
hub / github.com/huggingface/transformers.js / max

Method max

packages/transformers/src/utils/tensor.js:794–808  ·  view source on GitHub ↗
(dim = null, keepdim = false)

Source from the content-addressed store, hash-verified

792 }
793
794 max(dim = null, keepdim = false) {
795 if (dim === null) {
796 // None to reduce over all dimensions.
797 const val = max(this.data)[0];
798 return new Tensor(
799 this.type,
800 [val],
801 [
802 /* scalar */
803 ],
804 );
805 }
806 const [type, result, resultDims] = reduce_helper((a, b) => Math.max(a, b), this, dim, keepdim, -Infinity);
807 return new Tensor(type, result, resultDims);
808 }
809
810 argmin(dim = null, keepdim = false) {
811 if (dim !== null) {

Callers 15

smart_resizeFunction · 0.80
crop_marginMethod · 0.80
pad_imageMethod · 0.80
padMethod · 0.80
cropMethod · 0.80
_db_conversion_helperFunction · 0.80
spectrogramFunction · 0.80
seedMethod · 0.80
interpolate_dataFunction · 0.80

Calls 2

maxFunction · 0.90
reduce_helperFunction · 0.85

Tested by

no test coverage detected