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

Method map

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

* Return a new Tensor with a callback function applied to each element. * @param {Function} callback - The function to apply to each element. It should take three arguments: * the current element, its index, and the tensor's data array. * @returns {Tensor}

(callback)

Source from the content-addressed store, hash-verified

229 * @returns {Tensor} A new Tensor with the callback function applied to each element.
230 */
231 map(callback) {
232 return this.clone().map_(callback);
233 }
234
235 /**
236 * Apply a callback function to each element of the tensor in place.

Callers 15

loadTokenizerFunction · 0.80
constructorMethod · 0.80
convert_tokens_to_idsMethod · 0.80
_callMethod · 0.80
batch_decodeMethod · 0.80
pipelineFunction · 0.80
_callMethod · 0.80
from_pretrainedMethod · 0.80
wrapFunction · 0.80
constructorMethod · 0.80
splitMethod · 0.80

Calls 2

cloneMethod · 0.95
map_Method · 0.80

Tested by 1