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

Method sub

packages/transformers/src/utils/tensor.js:320–322  ·  view source on GitHub ↗

* Return a new Tensor with every element subtracted by a constant. * @param {number} val The value to subtract by. * @returns {Tensor} The new tensor.

(val)

Source from the content-addressed store, hash-verified

318 * @returns {Tensor} The new tensor.
319 */
320 sub(val) {
321 return this.clone().sub_(val);
322 }
323
324 /**
325 * Subtract the tensor by a constant in place.

Callers 3

_callMethod · 0.80
tensor.test.jsFile · 0.80
mainFunction · 0.80

Calls 2

cloneMethod · 0.95
sub_Method · 0.80

Tested by

no test coverage detected