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

Method clone

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

* Creates a deep copy of the current Tensor. * @returns {Tensor} A new Tensor with the same type, data, and dimensions as the original.

()

Source from the content-addressed store, hash-verified

339 * @returns {Tensor} A new Tensor with the same type, data, and dimensions as the original.
340 */
341 clone() {
342 return new Tensor(this.type, this.data.slice(), this.dims.slice());
343 }
344
345 /**
346 * Performs a slice operation on the Tensor along specified dimensions.

Callers 15

sigmoidMethod · 0.95
mapMethod · 0.95
mulMethod · 0.95
divMethod · 0.95
addMethod · 0.95
subMethod · 0.95
normalizeMethod · 0.95
flattenMethod · 0.95
negMethod · 0.95
clampMethod · 0.95
roundMethod · 0.95
repeatMethod · 0.95

Calls 1

sliceMethod · 0.45

Tested by 1

matchMethod · 0.36