Buckets:

download
raw
195 kB
<meta charset="utf-8" /><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;utils/tensor&quot;,&quot;local&quot;:&quot;utilstensor&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;utils/tensor.Tensor&quot;,&quot;local&quot;:&quot;utilstensortensor&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;new Tensor(...args)&quot;,&quot;local&quot;:&quot;new-tensorargs&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.dims : Array&quot;,&quot;local&quot;:&quot;tensordims--array&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.type : DataType&quot;,&quot;local&quot;:&quot;tensortype--datatype&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.data : DataArray&quot;,&quot;local&quot;:&quot;tensordata--dataarray&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.size : number&quot;,&quot;local&quot;:&quot;tensorsize--number&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.location : string&quot;,&quot;local&quot;:&quot;tensorlocation--string&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.Symbol.iterator() ⇒ Iterator. < any >&quot;,&quot;local&quot;:&quot;tensorsymboliterator--iterator--any-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor._getitem(index) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorgetitemindex--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.indexOf(item) ⇒ number&quot;,&quot;local&quot;:&quot;tensorindexofitem--number&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor._subarray(index, iterSize, iterDims) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsubarrayindex-itersize-iterdims--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.item() ⇒ number | bigint&quot;,&quot;local&quot;:&quot;tensoritem--number--bigint&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.tolist() ⇒ Array&quot;,&quot;local&quot;:&quot;tensortolist--array&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.sigmoid() ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsigmoid--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.sigmoid_() ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsigmoid--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.map(callback) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensormapcallback--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.map_(callback) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensormapcallback--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.mul(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensormulval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.mul_(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensormulval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.div(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensordivval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.div_(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensordivval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.add(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensoraddval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.add_(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensoraddval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.sub(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsubval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.sub_(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsubval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.clone() ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorclone--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.slice(...slices) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsliceslices--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.permute(...dims) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorpermutedims--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.transpose() : Tensor&quot;,&quot;local&quot;:&quot;tensortranspose--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.sum([dim], keepdim) ⇒&quot;,&quot;local&quot;:&quot;tensorsumdim-keepdim-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.norm([p], [dim], [keepdim]) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensornormp-dim-keepdim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.normalize_([p], [dim]) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensornormalizep-dim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.normalize([p], [dim]) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensornormalizep-dim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.stride() ⇒ Array&quot;,&quot;local&quot;:&quot;tensorstride--array&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.squeeze([dim]) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsqueezedim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.squeeze_()&quot;,&quot;local&quot;:&quot;tensorsqueeze&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.unsqueeze(dim) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorunsqueezedim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.unsqueeze_() : Tensor&quot;,&quot;local&quot;:&quot;tensorunsqueeze--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.flatten_()&quot;,&quot;local&quot;:&quot;tensorflatten&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.flatten(start_dim, end_dim) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorflattenstartdim-enddim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.view(...dims) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorviewdims--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.gt(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorgtval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.lt(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorltval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.clamp_() : Tensor&quot;,&quot;local&quot;:&quot;tensorclamp--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.clamp(min, max) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorclampmin-max--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.round_()&quot;,&quot;local&quot;:&quot;tensorround&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.round() ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorround--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.repeat(...repeats) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorrepeatrepeats--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.tile(...dims) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensortiledims--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.to(type) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensortotype--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.permute(tensor, axes) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorpermutetensor-axes--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.interpolate(input, size, mode, align_corners) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorinterpolateinput-size-mode-aligncorners--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.interpolate_4d(input, options) ⇒ Promise. < Tensor >&quot;,&quot;local&quot;:&quot;utilstensorinterpolate4dinput-options--promise--tensor-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.matmul(a, b) ⇒ Promise. < Tensor >&quot;,&quot;local&quot;:&quot;utilstensormatmula-b--promise--tensor-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.rfft(x, a) ⇒ Promise. < Tensor >&quot;,&quot;local&quot;:&quot;utilstensorrfftx-a--promise--tensor-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.topk(x, [k]) ⇒ Promise. < Array >&quot;,&quot;local&quot;:&quot;utilstensortopkx-k--promise--array-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.slice(data:, starts:, ends:, axes:, [steps]) ⇒ Promise. < Tensor >&quot;,&quot;local&quot;:&quot;utilstensorslicedata-starts-ends-axes-steps--promise--tensor-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.mean_pooling(last_hidden_state, attention_mask) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensormeanpoolinglasthiddenstate-attentionmask--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.layer_norm(input, normalized_shape, options) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorlayernorminput-normalizedshape-options--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.cat(tensors, dim) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorcattensors-dim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.stack(tensors, dim) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorstacktensors-dim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.std_mean(input, dim, correction, keepdim) ⇒ Array&quot;,&quot;local&quot;:&quot;utilstensorstdmeaninput-dim-correction-keepdim--array&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.mean(input, dim, keepdim) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensormeaninput-dim-keepdim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.full(size, fill_value) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorfullsize-fillvalue--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.ones(size) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensoronessize--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.ones_like(tensor) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensoronesliketensor--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.zeros(size) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorzerossize--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.zeros_like(tensor) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorzerosliketensor--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.rand(size) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorrandsize--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.randn(size) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorrandnsize--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.quantize_embeddings(tensor, precision) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorquantizeembeddingstensor-precision--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor~args[0] : ONNXTensor&quot;,&quot;local&quot;:&quot;utilstensorargs0--onnxtensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor~reshape(data, dimensions) ⇒ NestArray. < T, DIM >&quot;,&quot;local&quot;:&quot;utilstensorreshapedata-dimensions--nestarray--t-dim-&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;reshape~reshapedArray : any&quot;,&quot;local&quot;:&quot;reshapereshapedarray--any&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor~reduce_helper(callbackfn, input, dim, keepdim, [initialValue]) ⇒ Array&quot;,&quot;local&quot;:&quot;utilstensorreducehelpercallbackfn-input-dim-keepdim-initialvalue--array&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor~DataArray : string&quot;,&quot;local&quot;:&quot;utilstensordataarray--string&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor~NestArray : any&quot;,&quot;local&quot;:&quot;utilstensornestarray--any&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}">
<link href="/docs/transformers.js/pr_1649/en/_app/immutable/assets/0.e3b0c442.css" rel="modulepreload">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/entry/start.5f753a22.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/scheduler.6efaaf90.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/singletons.c0807d75.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/paths.c5938264.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/entry/app.db3dfcb7.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/preload-helper.1d8e1e5d.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/index.eb3e1f0f.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/nodes/0.1b727385.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/each.e59479a4.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/nodes/24.0879ecbd.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/MermaidChart.svelte_svelte_type_style_lang.16f13047.js">
<link rel="modulepreload" href="/docs/transformers.js/pr_1649/en/_app/immutable/chunks/CodeBlock.72c8dd07.js"><!-- HEAD_svelte-u9bgzb_START --><meta name="hf:doc:metadata" content="{&quot;title&quot;:&quot;utils/tensor&quot;,&quot;local&quot;:&quot;utilstensor&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;utils/tensor.Tensor&quot;,&quot;local&quot;:&quot;utilstensortensor&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;new Tensor(...args)&quot;,&quot;local&quot;:&quot;new-tensorargs&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.dims : Array&quot;,&quot;local&quot;:&quot;tensordims--array&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.type : DataType&quot;,&quot;local&quot;:&quot;tensortype--datatype&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.data : DataArray&quot;,&quot;local&quot;:&quot;tensordata--dataarray&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.size : number&quot;,&quot;local&quot;:&quot;tensorsize--number&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.location : string&quot;,&quot;local&quot;:&quot;tensorlocation--string&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.Symbol.iterator() ⇒ Iterator. < any >&quot;,&quot;local&quot;:&quot;tensorsymboliterator--iterator--any-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor._getitem(index) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorgetitemindex--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.indexOf(item) ⇒ number&quot;,&quot;local&quot;:&quot;tensorindexofitem--number&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor._subarray(index, iterSize, iterDims) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsubarrayindex-itersize-iterdims--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.item() ⇒ number | bigint&quot;,&quot;local&quot;:&quot;tensoritem--number--bigint&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.tolist() ⇒ Array&quot;,&quot;local&quot;:&quot;tensortolist--array&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.sigmoid() ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsigmoid--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.sigmoid_() ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsigmoid--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.map(callback) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensormapcallback--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.map_(callback) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensormapcallback--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.mul(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensormulval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.mul_(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensormulval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.div(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensordivval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.div_(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensordivval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.add(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensoraddval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.add_(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensoraddval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.sub(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsubval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.sub_(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsubval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.clone() ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorclone--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.slice(...slices) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsliceslices--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.permute(...dims) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorpermutedims--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.transpose() : Tensor&quot;,&quot;local&quot;:&quot;tensortranspose--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.sum([dim], keepdim) ⇒&quot;,&quot;local&quot;:&quot;tensorsumdim-keepdim-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.norm([p], [dim], [keepdim]) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensornormp-dim-keepdim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.normalize_([p], [dim]) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensornormalizep-dim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.normalize([p], [dim]) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensornormalizep-dim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.stride() ⇒ Array&quot;,&quot;local&quot;:&quot;tensorstride--array&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.squeeze([dim]) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorsqueezedim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.squeeze_()&quot;,&quot;local&quot;:&quot;tensorsqueeze&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.unsqueeze(dim) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorunsqueezedim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.unsqueeze_() : Tensor&quot;,&quot;local&quot;:&quot;tensorunsqueeze--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.flatten_()&quot;,&quot;local&quot;:&quot;tensorflatten&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.flatten(start_dim, end_dim) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorflattenstartdim-enddim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.view(...dims) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorviewdims--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.gt(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorgtval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.lt(val) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorltval--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.clamp_() : Tensor&quot;,&quot;local&quot;:&quot;tensorclamp--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.clamp(min, max) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorclampmin-max--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.round_()&quot;,&quot;local&quot;:&quot;tensorround&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.round() ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorround--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.repeat(...repeats) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensorrepeatrepeats--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.tile(...dims) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensortiledims--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3},{&quot;title&quot;:&quot;tensor.to(type) ⇒ Tensor&quot;,&quot;local&quot;:&quot;tensortotype--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.permute(tensor, axes) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorpermutetensor-axes--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.interpolate(input, size, mode, align_corners) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorinterpolateinput-size-mode-aligncorners--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.interpolate_4d(input, options) ⇒ Promise. < Tensor >&quot;,&quot;local&quot;:&quot;utilstensorinterpolate4dinput-options--promise--tensor-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.matmul(a, b) ⇒ Promise. < Tensor >&quot;,&quot;local&quot;:&quot;utilstensormatmula-b--promise--tensor-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.rfft(x, a) ⇒ Promise. < Tensor >&quot;,&quot;local&quot;:&quot;utilstensorrfftx-a--promise--tensor-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.topk(x, [k]) ⇒ Promise. < Array >&quot;,&quot;local&quot;:&quot;utilstensortopkx-k--promise--array-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.slice(data:, starts:, ends:, axes:, [steps]) ⇒ Promise. < Tensor >&quot;,&quot;local&quot;:&quot;utilstensorslicedata-starts-ends-axes-steps--promise--tensor-&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.mean_pooling(last_hidden_state, attention_mask) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensormeanpoolinglasthiddenstate-attentionmask--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.layer_norm(input, normalized_shape, options) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorlayernorminput-normalizedshape-options--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.cat(tensors, dim) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorcattensors-dim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.stack(tensors, dim) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorstacktensors-dim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.std_mean(input, dim, correction, keepdim) ⇒ Array&quot;,&quot;local&quot;:&quot;utilstensorstdmeaninput-dim-correction-keepdim--array&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.mean(input, dim, keepdim) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensormeaninput-dim-keepdim--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.full(size, fill_value) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorfullsize-fillvalue--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.ones(size) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensoronessize--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.ones_like(tensor) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensoronesliketensor--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.zeros(size) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorzerossize--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.zeros_like(tensor) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorzerosliketensor--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.rand(size) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorrandsize--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.randn(size) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorrandnsize--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor.quantize_embeddings(tensor, precision) ⇒ Tensor&quot;,&quot;local&quot;:&quot;utilstensorquantizeembeddingstensor-precision--tensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor~args[0] : ONNXTensor&quot;,&quot;local&quot;:&quot;utilstensorargs0--onnxtensor&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor~reshape(data, dimensions) ⇒ NestArray. < T, DIM >&quot;,&quot;local&quot;:&quot;utilstensorreshapedata-dimensions--nestarray--t-dim-&quot;,&quot;sections&quot;:[{&quot;title&quot;:&quot;reshape~reshapedArray : any&quot;,&quot;local&quot;:&quot;reshapereshapedarray--any&quot;,&quot;sections&quot;:[],&quot;depth&quot;:3}],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor~reduce_helper(callbackfn, input, dim, keepdim, [initialValue]) ⇒ Array&quot;,&quot;local&quot;:&quot;utilstensorreducehelpercallbackfn-input-dim-keepdim-initialvalue--array&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor~DataArray : string&quot;,&quot;local&quot;:&quot;utilstensordataarray--string&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2},{&quot;title&quot;:&quot;utils/tensor~NestArray : any&quot;,&quot;local&quot;:&quot;utilstensornestarray--any&quot;,&quot;sections&quot;:[],&quot;depth&quot;:2}],&quot;depth&quot;:1}"><!-- HEAD_svelte-u9bgzb_END --> <p></p> <a id="module_utils/tensor" class="group"></a> <div class="items-center shrink-0 min-w-[100px] max-sm:min-w-[50px] justify-end ml-auto flex" style="float: right; margin-left: 10px; display: inline-flex; position: relative; z-index: 10;"><div class="inline-flex rounded-md max-sm:rounded-sm"><button class="inline-flex items-center gap-1 h-7 max-sm:h-7 px-2 max-sm:px-1.5 text-sm font-medium text-gray-800 border border-r-0 rounded-l-md max-sm:rounded-l-sm border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-live="polite"><span class="inline-flex items-center justify-center rounded-md p-0.5 max-sm:p-0 hover:text-gray-800 dark:hover:text-gray-200"><svg class="sm:size-3.5 size-3" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg></span> <span>Copy page</span></button> <button class="inline-flex items-center justify-center w-6 max-sm:w-5 h-7 max-sm:h-7 disabled:pointer-events-none text-sm text-gray-500 hover:text-gray-700 dark:hover:text-white rounded-r-md max-sm:rounded-r-sm border border-l transition border-gray-200 bg-white hover:shadow-inner dark:border-gray-850 dark:bg-gray-950 dark:text-gray-200 dark:hover:bg-gray-800" aria-haspopup="menu" aria-expanded="false" aria-label="Open copy menu"><svg class="transition-transform text-gray-400 overflow-visible sm:size-3.5 size-3 rotate-0" width="1em" height="1em" viewBox="0 0 12 7" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M1 1L6 6L11 1" stroke="currentColor"></path></svg></button></div> </div> <h1 class="relative group"><a id="utilstensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor</span></h1> <p data-svelte-h="svelte-uw4y1m">Helper module for <code>Tensor</code> processing.</p> <p data-svelte-h="svelte-il3kl8">These functions and classes are only used internally,
meaning an end-user shouldn’t need to access anything here.</p> <ul data-svelte-h="svelte-1p8mm89"><li><a href="#module_utils/tensor">utils/tensor</a> <ul><li><em>static</em> <ul><li><a href="#module_utils/tensor.Tensor">.Tensor</a> <ul><li><a href="#new_module_utils/tensor.Tensor_new"><code>new Tensor(...args)</code></a></li> <li><a href="#module_utils/tensor.Tensor+dims"><code>.dims</code></a> : <code>Array</code></li> <li><a href="#module_utils/tensor.Tensor+type"><code>.type</code></a> : <a href="#DataType"><code>DataType</code></a></li> <li><a href="#module_utils/tensor.Tensor+data"><code>.data</code></a> : <code>DataArray</code></li> <li><a href="#module_utils/tensor.Tensor+size"><code>.size</code></a> : <code>number</code></li> <li><a href="#module_utils/tensor.Tensor+location"><code>.location</code></a> : <code>string</code></li> <li><a href="#module_utils/tensor.Tensor+Symbol.iterator"><code>.Symbol.iterator()</code></a><code>Iterator.&lt;any&gt;</code></li> <li><a href="#module_utils/tensor.Tensor+_getitem"><code>._getitem(index)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+indexOf"><code>.indexOf(item)</code></a><code>number</code></li> <li><a href="#module_utils/tensor.Tensor+_subarray"><code>._subarray(index, iterSize, iterDims)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+item"><code>.item()</code></a><code>number</code> | <code>bigint</code></li> <li><a href="#module_utils/tensor.Tensor+tolist"><code>.tolist()</code></a><code>Array</code></li> <li><a href="#module_utils/tensor.Tensor+sigmoid"><code>.sigmoid()</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+sigmoid_"><code>.sigmoid_()</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+map"><code>.map(callback)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+map_"><code>.map_(callback)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+mul"><code>.mul(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+mul_"><code>.mul_(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+div"><code>.div(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+div_"><code>.div_(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+add"><code>.add(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+add_"><code>.add_(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+sub"><code>.sub(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+sub_"><code>.sub_(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+clone"><code>.clone()</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+slice"><code>.slice(...slices)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+permute"><code>.permute(...dims)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+transpose"><code>.transpose()</code></a> : <a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+sum"><code>.sum([dim], keepdim)</code></a></li> <li><a href="#module_utils/tensor.Tensor+norm"><code>.norm([p], [dim], [keepdim])</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+normalize_"><code>.normalize_([p], [dim])</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+normalize"><code>.normalize([p], [dim])</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+stride"><code>.stride()</code></a><code>Array</code></li> <li><a href="#module_utils/tensor.Tensor+squeeze"><code>.squeeze([dim])</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+squeeze_"><code>.squeeze_()</code></a></li> <li><a href="#module_utils/tensor.Tensor+unsqueeze"><code>.unsqueeze(dim)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+unsqueeze_"><code>.unsqueeze_()</code></a> : <a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+flatten_"><code>.flatten_()</code></a></li> <li><a href="#module_utils/tensor.Tensor+flatten"><code>.flatten(start_dim, end_dim)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+view"><code>.view(...dims)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+gt"><code>.gt(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+lt"><code>.lt(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+clamp_"><code>.clamp_()</code></a> : <a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+clamp"><code>.clamp(min, max)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+round_"><code>.round_()</code></a></li> <li><a href="#module_utils/tensor.Tensor+round"><code>.round()</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+repeat"><code>.repeat(...repeats)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+tile"><code>.tile(...dims)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+to"><code>.to(type)</code></a><a href="#Tensor"><code>Tensor</code></a></li></ul></li> <li><a href="#module_utils/tensor.permute"><code>.permute(tensor, axes)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.interpolate"><code>.interpolate(input, size, mode, align_corners)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.interpolate_4d"><code>.interpolate_4d(input, options)</code></a><a href="#Tensor"><code>Promise.&lt;Tensor&gt;</code></a></li> <li><a href="#module_utils/tensor.matmul"><code>.matmul(a, b)</code></a><a href="#Tensor"><code>Promise.&lt;Tensor&gt;</code></a></li> <li><a href="#module_utils/tensor.rfft"><code>.rfft(x, a)</code></a><a href="#Tensor"><code>Promise.&lt;Tensor&gt;</code></a></li> <li><a href="#module_utils/tensor.topk"><code>.topk(x, [k])</code></a><code>Promise.&lt;Array&gt;</code></li> <li><a href="#module_utils/tensor.slice"><code>.slice(data:, starts:, ends:, axes:, [steps])</code></a><a href="#Tensor"><code>Promise.&lt;Tensor&gt;</code></a></li> <li><a href="#module_utils/tensor.mean_pooling"><code>.mean_pooling(last_hidden_state, attention_mask)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.layer_norm"><code>.layer_norm(input, normalized_shape, options)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.cat"><code>.cat(tensors, dim)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.stack"><code>.stack(tensors, dim)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.std_mean"><code>.std_mean(input, dim, correction, keepdim)</code></a><code>Array</code></li> <li><a href="#module_utils/tensor.mean"><code>.mean(input, dim, keepdim)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.full"><code>.full(size, fill_value)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.ones"><code>.ones(size)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.ones_like"><code>.ones_like(tensor)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.zeros"><code>.zeros(size)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.zeros_like"><code>.zeros_like(tensor)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.rand"><code>.rand(size)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.randn"><code>.randn(size)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.quantize_embeddings"><code>.quantize_embeddings(tensor, precision)</code></a><a href="#Tensor"><code>Tensor</code></a></li></ul></li> <li><em>inner</em> <ul><li><a href="#module_utils/tensor..args%5B0%5D"><code>~args[0]</code></a> : <code>ONNXTensor</code></li> <li><a href="#module_utils/tensor..reshape"><code>~reshape(data, dimensions)</code></a><code>NestArray.&lt;T, DIM&gt;</code> <ul><li><a href="#module_utils/tensor..reshape..reshapedArray"><code>~reshapedArray</code></a> : <code>any</code></li></ul></li> <li><a href="#module_utils/tensor..reduce_helper"><code>~reduce_helper(callbackfn, input, dim, keepdim, [initialValue])</code></a><code>Array</code></li> <li><a href="#module_utils/tensor..DataArray"><code>~DataArray</code></a> : <code>string</code></li> <li><a href="#module_utils/tensor..NestArray"><code>~NestArray</code></a> : <code>any</code></li></ul></li></ul></li></ul> <hr> <a id="module_utils/tensor.Tensor" class="group"></a> <h2 class="relative group"><a id="utilstensortensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensortensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.Tensor</span></h2> <p data-svelte-h="svelte-1ugrfrw"><strong>Kind</strong>: static class of <a href="#module_utils/tensor"><code>utils/tensor</code></a></p> <ul data-svelte-h="svelte-g1vdmb"><li><a href="#module_utils/tensor.Tensor">.Tensor</a> <ul><li><a href="#new_module_utils/tensor.Tensor_new"><code>new Tensor(...args)</code></a></li> <li><a href="#module_utils/tensor.Tensor+dims"><code>.dims</code></a> : <code>Array</code></li> <li><a href="#module_utils/tensor.Tensor+type"><code>.type</code></a> : <a href="#DataType"><code>DataType</code></a></li> <li><a href="#module_utils/tensor.Tensor+data"><code>.data</code></a> : <code>DataArray</code></li> <li><a href="#module_utils/tensor.Tensor+size"><code>.size</code></a> : <code>number</code></li> <li><a href="#module_utils/tensor.Tensor+location"><code>.location</code></a> : <code>string</code></li> <li><a href="#module_utils/tensor.Tensor+Symbol.iterator"><code>.Symbol.iterator()</code></a><code>Iterator.&lt;any&gt;</code></li> <li><a href="#module_utils/tensor.Tensor+_getitem"><code>._getitem(index)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+indexOf"><code>.indexOf(item)</code></a><code>number</code></li> <li><a href="#module_utils/tensor.Tensor+_subarray"><code>._subarray(index, iterSize, iterDims)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+item"><code>.item()</code></a><code>number</code> | <code>bigint</code></li> <li><a href="#module_utils/tensor.Tensor+tolist"><code>.tolist()</code></a><code>Array</code></li> <li><a href="#module_utils/tensor.Tensor+sigmoid"><code>.sigmoid()</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+sigmoid_"><code>.sigmoid_()</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+map"><code>.map(callback)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+map_"><code>.map_(callback)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+mul"><code>.mul(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+mul_"><code>.mul_(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+div"><code>.div(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+div_"><code>.div_(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+add"><code>.add(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+add_"><code>.add_(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+sub"><code>.sub(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+sub_"><code>.sub_(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+clone"><code>.clone()</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+slice"><code>.slice(...slices)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+permute"><code>.permute(...dims)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+transpose"><code>.transpose()</code></a> : <a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+sum"><code>.sum([dim], keepdim)</code></a></li> <li><a href="#module_utils/tensor.Tensor+norm"><code>.norm([p], [dim], [keepdim])</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+normalize_"><code>.normalize_([p], [dim])</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+normalize"><code>.normalize([p], [dim])</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+stride"><code>.stride()</code></a><code>Array</code></li> <li><a href="#module_utils/tensor.Tensor+squeeze"><code>.squeeze([dim])</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+squeeze_"><code>.squeeze_()</code></a></li> <li><a href="#module_utils/tensor.Tensor+unsqueeze"><code>.unsqueeze(dim)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+unsqueeze_"><code>.unsqueeze_()</code></a> : <a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+flatten_"><code>.flatten_()</code></a></li> <li><a href="#module_utils/tensor.Tensor+flatten"><code>.flatten(start_dim, end_dim)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+view"><code>.view(...dims)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+gt"><code>.gt(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+lt"><code>.lt(val)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+clamp_"><code>.clamp_()</code></a> : <a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+clamp"><code>.clamp(min, max)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+round_"><code>.round_()</code></a></li> <li><a href="#module_utils/tensor.Tensor+round"><code>.round()</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+repeat"><code>.repeat(...repeats)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+tile"><code>.tile(...dims)</code></a><a href="#Tensor"><code>Tensor</code></a></li> <li><a href="#module_utils/tensor.Tensor+to"><code>.to(type)</code></a><a href="#Tensor"><code>Tensor</code></a></li></ul></li></ul> <hr> <a id="new_module_utils/tensor.Tensor_new" class="group"></a> <h3 class="relative group"><a id="new-tensorargs" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#new-tensorargs"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>new Tensor(...args)</span></h3> <p data-svelte-h="svelte-55wecd">Create a new Tensor or copy an existing Tensor.</p> <table data-svelte-h="svelte-1t53q7y"><thead><tr><th>Param</th><th>Type</th></tr></thead> <tbody><tr><td>...args</td><td><code>Array</code> | <code>Array</code></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+dims" class="group"></a> <h3 class="relative group"><a id="tensordims--array" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensordims--array"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.dims : Array</span></h3> <p data-svelte-h="svelte-1gc2rt4">Dimensions of the tensor.</p> <p data-svelte-h="svelte-10qzguj"><strong>Kind</strong>: instance property of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+type" class="group"></a> <h3 class="relative group"><a id="tensortype--datatype" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensortype--datatype"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.type : DataType</span></h3> <p data-svelte-h="svelte-81y0bb">Type of the tensor.</p> <p data-svelte-h="svelte-10qzguj"><strong>Kind</strong>: instance property of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+data" class="group"></a> <h3 class="relative group"><a id="tensordata--dataarray" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensordata--dataarray"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.data : DataArray</span></h3> <p data-svelte-h="svelte-1eqabt7">The data stored in the tensor.</p> <p data-svelte-h="svelte-10qzguj"><strong>Kind</strong>: instance property of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+size" class="group"></a> <h3 class="relative group"><a id="tensorsize--number" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorsize--number"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.size : number</span></h3> <p data-svelte-h="svelte-krrt97">The number of elements in the tensor.</p> <p data-svelte-h="svelte-10qzguj"><strong>Kind</strong>: instance property of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+location" class="group"></a> <h3 class="relative group"><a id="tensorlocation--string" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorlocation--string"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.location : string</span></h3> <p data-svelte-h="svelte-1iaptgl">The location of the tensor data.</p> <p data-svelte-h="svelte-10qzguj"><strong>Kind</strong>: instance property of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+Symbol.iterator" class="group"></a> <h3 class="relative group"><a id="tensorsymboliterator--iterator--any-" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorsymboliterator--iterator--any-"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.Symbol.iterator() ⇒ Iterator. &lt; any ></span></h3> <p data-svelte-h="svelte-1adn56z">Returns an iterator object for iterating over the tensor data in row-major order.
If the tensor has more than one dimension, the iterator will yield subarrays.</p> <p data-svelte-h="svelte-thtwyy"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <code>Iterator.&lt;any&gt;</code> - An iterator object for iterating over the tensor data in row-major order.</p> <hr> <a id="module_utils/tensor.Tensor+_getitem" class="group"></a> <h3 class="relative group"><a id="tensorgetitemindex--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorgetitemindex--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor._getitem(index) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1u97xg1">Index into a Tensor object.</p> <p data-svelte-h="svelte-1fs0j1e"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The data at the specified index.</p> <table data-svelte-h="svelte-1kq04ga"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>index</td><td><code>number</code></td><td><p>The index to access.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+indexOf" class="group"></a> <h3 class="relative group"><a id="tensorindexofitem--number" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorindexofitem--number"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.indexOf(item) ⇒ number</span></h3> <p data-svelte-h="svelte-1cg22af"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <code>number</code> - The index of the first occurrence of item in the tensor data.</p> <table data-svelte-h="svelte-1hful42"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>item</td><td><code>number</code> | <code>bigint</code></td><td><p>The item to search for in the tensor</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+_subarray" class="group"></a> <h3 class="relative group"><a id="tensorsubarrayindex-itersize-iterdims--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorsubarrayindex-itersize-iterdims--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor._subarray(index, iterSize, iterDims) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1mr58c3"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <table data-svelte-h="svelte-153ftfy"><thead><tr><th>Param</th><th>Type</th></tr></thead> <tbody><tr><td>index</td><td><code>number</code></td> </tr><tr><td>iterSize</td><td><code>number</code></td> </tr><tr><td>iterDims</td><td><code>any</code></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+item" class="group"></a> <h3 class="relative group"><a id="tensoritem--number--bigint" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensoritem--number--bigint"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.item() ⇒ number | bigint</span></h3> <p data-svelte-h="svelte-13nzfs3">Returns the value of this tensor as a standard JavaScript Number. This only works
for tensors with one element. For other cases, see <code>Tensor.tolist()</code>.</p> <p data-svelte-h="svelte-11rv1mu"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <code>number</code> | <code>bigint</code> - The value of this tensor as a standard JavaScript Number.<br> <strong>Throws</strong>:</p> <ul data-svelte-h="svelte-1mt1j0z"><li><code>Error</code> If the tensor has more than one element.</li></ul> <hr> <a id="module_utils/tensor.Tensor+tolist" class="group"></a> <h3 class="relative group"><a id="tensortolist--array" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensortolist--array"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.tolist() ⇒ Array</span></h3> <p data-svelte-h="svelte-87xdyr">Convert tensor data to a n-dimensional JS list</p> <p data-svelte-h="svelte-1mr58c3"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+sigmoid" class="group"></a> <h3 class="relative group"><a id="tensorsigmoid--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorsigmoid--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.sigmoid() ⇒ Tensor</span></h3> <p data-svelte-h="svelte-2wti2w">Return a new Tensor with the sigmoid function applied to each element.</p> <p data-svelte-h="svelte-1y8z3p1"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The tensor with the sigmoid function applied.</p> <hr> <a id="module_utils/tensor.Tensor+sigmoid_" class="group"></a> <h3 class="relative group"><a id="tensorsigmoid--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorsigmoid--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.sigmoid_() ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1edu6c8">Applies the sigmoid function to the tensor in place.</p> <p data-svelte-h="svelte-1t595qz"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - Returns <code>this</code>.</p> <hr> <a id="module_utils/tensor.Tensor+map" class="group"></a> <h3 class="relative group"><a id="tensormapcallback--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensormapcallback--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.map(callback) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-az0crx">Return a new Tensor with a callback function applied to each element.</p> <p data-svelte-h="svelte-w5myiy"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - A new Tensor with the callback function applied to each element.</p> <table data-svelte-h="svelte-1ok4yhn"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>callback</td><td><code>function</code></td><td><p>The function to apply to each element. It should take three arguments:
the current element, its index, and the tensor&#39;s data array.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+map_" class="group"></a> <h3 class="relative group"><a id="tensormapcallback--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensormapcallback--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.map_(callback) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-jlfq15">Apply a callback function to each element of the tensor in place.</p> <p data-svelte-h="svelte-1t595qz"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - Returns <code>this</code>.</p> <table data-svelte-h="svelte-1ok4yhn"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>callback</td><td><code>function</code></td><td><p>The function to apply to each element. It should take three arguments:
the current element, its index, and the tensor&#39;s data array.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+mul" class="group"></a> <h3 class="relative group"><a id="tensormulval--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensormulval--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.mul(val) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-xg80lg">Return a new Tensor with every element multiplied by a constant.</p> <p data-svelte-h="svelte-9qu32j"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The new tensor.</p> <table data-svelte-h="svelte-1tbtmqd"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>val</td><td><code>number</code></td><td><p>The value to multiply by.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+mul_" class="group"></a> <h3 class="relative group"><a id="tensormulval--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensormulval--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.mul_(val) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1i12x1s">Multiply the tensor by a constant in place.</p> <p data-svelte-h="svelte-1t595qz"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - Returns <code>this</code>.</p> <table data-svelte-h="svelte-1tbtmqd"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>val</td><td><code>number</code></td><td><p>The value to multiply by.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+div" class="group"></a> <h3 class="relative group"><a id="tensordivval--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensordivval--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.div(val) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-45kvaw">Return a new Tensor with every element divided by a constant.</p> <p data-svelte-h="svelte-9qu32j"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The new tensor.</p> <table data-svelte-h="svelte-46t58i"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>val</td><td><code>number</code></td><td><p>The value to divide by.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+div_" class="group"></a> <h3 class="relative group"><a id="tensordivval--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensordivval--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.div_(val) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-6s524n">Divide the tensor by a constant in place.</p> <p data-svelte-h="svelte-1t595qz"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - Returns <code>this</code>.</p> <table data-svelte-h="svelte-46t58i"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>val</td><td><code>number</code></td><td><p>The value to divide by.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+add" class="group"></a> <h3 class="relative group"><a id="tensoraddval--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensoraddval--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.add(val) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1hl64jn">Return a new Tensor with every element added by a constant.</p> <p data-svelte-h="svelte-9qu32j"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The new tensor.</p> <table data-svelte-h="svelte-1p5444"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>val</td><td><code>number</code></td><td><p>The value to add by.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+add_" class="group"></a> <h3 class="relative group"><a id="tensoraddval--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensoraddval--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.add_(val) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-bbf4x3">Add the tensor by a constant in place.</p> <p data-svelte-h="svelte-1t595qz"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - Returns <code>this</code>.</p> <table data-svelte-h="svelte-1p5444"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>val</td><td><code>number</code></td><td><p>The value to add by.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+sub" class="group"></a> <h3 class="relative group"><a id="tensorsubval--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorsubval--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.sub(val) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-wbrx6g">Return a new Tensor with every element subtracted by a constant.</p> <p data-svelte-h="svelte-9qu32j"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The new tensor.</p> <table data-svelte-h="svelte-flm2g1"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>val</td><td><code>number</code></td><td><p>The value to subtract by.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+sub_" class="group"></a> <h3 class="relative group"><a id="tensorsubval--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorsubval--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.sub_(val) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-wqxtec">Subtract the tensor by a constant in place.</p> <p data-svelte-h="svelte-1t595qz"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - Returns <code>this</code>.</p> <table data-svelte-h="svelte-flm2g1"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>val</td><td><code>number</code></td><td><p>The value to subtract by.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+clone" class="group"></a> <h3 class="relative group"><a id="tensorclone--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorclone--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.clone() ⇒ Tensor</span></h3> <p data-svelte-h="svelte-zftqbb">Creates a deep copy of the current Tensor.</p> <p data-svelte-h="svelte-1mgj1au"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - A new Tensor with the same type, data, and dimensions as the original.</p> <hr> <a id="module_utils/tensor.Tensor+slice" class="group"></a> <h3 class="relative group"><a id="tensorsliceslices--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorsliceslices--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.slice(...slices) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-yalim1">Performs a slice operation on the Tensor along specified dimensions.</p> <p data-svelte-h="svelte-v4sb1d">Consider a Tensor that has a dimension of [4, 7]:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-string">[ 1, 2, 3, 4, 5, 6, 7]</span>
<span class="hljs-string">[ 8, 9, 10, 11, 12, 13, 14]</span>
<span class="hljs-string">[15, 16, 17, 18, 19, 20, 21]</span>
<span class="hljs-string">[22, 23, 24, 25, 26, 27, 28]</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1qggjsc">We can slice against the two dims of row and column, for instance in this
case we can start at the second element, and return to the second last,
like this:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-attribute">tensor</span>.slice([<span class="hljs-number">1</span>, -<span class="hljs-number">1</span>],<span class="hljs-meta"> [1, -1]);</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-gtrr4w">which would return:</p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-string">[ 9, 10, 11, 12, 13 ]</span>
<span class="hljs-string">[ 16, 17, 18, 19, 20 ]</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-15hbb4u"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - A new Tensor containing the selected elements.<br> <strong>Throws</strong>:</p> <ul data-svelte-h="svelte-4zzknf"><li><code>Error</code> If the slice input is invalid.</li></ul> <table data-svelte-h="svelte-r7yjm7"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>...slices</td><td><code>number</code> | <code>Array</code> | <code>null</code></td><td><p>The slice specifications for each dimension.</p> <ul><li>If a number is given, then a single element is selected.</li> <li>If an array of two numbers is given, then a range of elements [start, end (exclusive)] is selected.</li> <li>If null is given, then the entire dimension is selected.</li></ul></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+permute" class="group"></a> <h3 class="relative group"><a id="tensorpermutedims--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorpermutedims--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.permute(...dims) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1g8ouql">Return a permuted version of this Tensor, according to the provided dimensions.</p> <p data-svelte-h="svelte-19cc47x"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The permuted tensor.</p> <table data-svelte-h="svelte-1p49qvp"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>...dims</td><td><code>number</code></td><td><p>Dimensions to permute.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+transpose" class="group"></a> <h3 class="relative group"><a id="tensortranspose--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensortranspose--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.transpose() : Tensor</span></h3> <p data-svelte-h="svelte-1mr58c3"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+sum" class="group"></a> <h3 class="relative group"><a id="tensorsumdim-keepdim-" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorsumdim-keepdim-"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.sum([dim], keepdim) ⇒</span></h3> <p data-svelte-h="svelte-yjryb1">Returns the sum of each row of the input tensor in the given dimension dim.</p> <p data-svelte-h="svelte-xtr8tc"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: The summed tensor</p> <table data-svelte-h="svelte-16lm03e"><thead><tr><th>Param</th><th>Type</th><th>Default</th><th>Description</th></tr></thead> <tbody><tr><td>[dim]</td><td><code>number</code> | <code>null</code></td><td><code></code></td><td><p>The dimension or dimensions to reduce. If <code>null</code>, all dimensions are reduced.</p></td> </tr><tr><td>keepdim</td><td><code>boolean</code></td><td><code>false</code></td><td><p>Whether the output tensor has <code>dim</code> retained or not.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+norm" class="group"></a> <h3 class="relative group"><a id="tensornormp-dim-keepdim--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensornormp-dim-keepdim--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.norm([p], [dim], [keepdim]) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1okfsqx">Returns the matrix norm or vector norm of a given tensor.</p> <p data-svelte-h="svelte-bqi4bh"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The norm of the tensor.</p> <table data-svelte-h="svelte-16sni1o"><thead><tr><th>Param</th><th>Type</th><th>Default</th><th>Description</th></tr></thead> <tbody><tr><td>[p]</td><td><code>number</code> | <code>string</code></td><td><code>&#39;fro&#39;</code></td><td><p>The order of norm</p></td> </tr><tr><td>[dim]</td><td><code>number</code> | <code>null</code></td><td><code></code></td><td><p>Specifies which dimension of the tensor to calculate the norm across.
If dim is None, the norm will be calculated across all dimensions of input.</p></td> </tr><tr><td>[keepdim]</td><td><code>boolean</code></td><td><code>false</code></td><td><p>Whether the output tensors have dim retained or not.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+normalize_" class="group"></a> <h3 class="relative group"><a id="tensornormalizep-dim--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensornormalizep-dim--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.normalize_([p], [dim]) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1htpbrk">Performs <code>L_p</code> normalization of inputs over specified dimension. Operates in place.</p> <p data-svelte-h="svelte-13o8e7b"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - <code>this</code> for operation chaining.</p> <table data-svelte-h="svelte-1qi99pl"><thead><tr><th>Param</th><th>Type</th><th>Default</th><th>Description</th></tr></thead> <tbody><tr><td>[p]</td><td><code>number</code></td><td><code>2</code></td><td><p>The exponent value in the norm formulation</p></td> </tr><tr><td>[dim]</td><td><code>number</code></td><td><code>1</code></td><td><p>The dimension to reduce</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+normalize" class="group"></a> <h3 class="relative group"><a id="tensornormalizep-dim--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensornormalizep-dim--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.normalize([p], [dim]) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1ztgqp">Performs <code>L_p</code> normalization of inputs over specified dimension.</p> <p data-svelte-h="svelte-oa1qug"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The normalized tensor.</p> <table data-svelte-h="svelte-1qi99pl"><thead><tr><th>Param</th><th>Type</th><th>Default</th><th>Description</th></tr></thead> <tbody><tr><td>[p]</td><td><code>number</code></td><td><code>2</code></td><td><p>The exponent value in the norm formulation</p></td> </tr><tr><td>[dim]</td><td><code>number</code></td><td><code>1</code></td><td><p>The dimension to reduce</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+stride" class="group"></a> <h3 class="relative group"><a id="tensorstride--array" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorstride--array"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.stride() ⇒ Array</span></h3> <p data-svelte-h="svelte-1a7u185">Compute and return the stride of this tensor.
Stride is the jump necessary to go from one element to the next one in the specified dimension dim.</p> <p data-svelte-h="svelte-or3iw"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <code>Array</code> - The stride of this tensor.</p> <hr> <a id="module_utils/tensor.Tensor+squeeze" class="group"></a> <h3 class="relative group"><a id="tensorsqueezedim--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorsqueezedim--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.squeeze([dim]) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-qls17b">Returns a tensor with all specified dimensions of input of size 1 removed.</p> <p data-svelte-h="svelte-5nabmy">NOTE: The returned tensor shares the storage with the input tensor, so changing the contents of one will change the contents of the other.
If you would like a copy, use <code>tensor.clone()</code> before squeezing.</p> <p data-svelte-h="svelte-1fl56ed"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The squeezed tensor</p> <table data-svelte-h="svelte-207pb5"><thead><tr><th>Param</th><th>Type</th><th>Default</th><th>Description</th></tr></thead> <tbody><tr><td>[dim]</td><td><code>number</code> | <code>Array</code> | <code>null</code></td><td><code></code></td><td><p>If given, the input will be squeezed only in the specified dimensions.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+squeeze_" class="group"></a> <h3 class="relative group"><a id="tensorsqueeze" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorsqueeze"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.squeeze_()</span></h3> <p data-svelte-h="svelte-19w0pic">In-place version of @see <a href="Tensor.squeeze">Tensor.squeeze</a></p> <p data-svelte-h="svelte-1mr58c3"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+unsqueeze" class="group"></a> <h3 class="relative group"><a id="tensorunsqueezedim--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorunsqueezedim--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.unsqueeze(dim) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-18ws76n">Returns a new tensor with a dimension of size one inserted at the specified position.</p> <p data-svelte-h="svelte-1tnr5gm">NOTE: The returned tensor shares the same underlying data with this tensor.</p> <p data-svelte-h="svelte-13m9nag"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The unsqueezed tensor</p> <table data-svelte-h="svelte-8dwbnh"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>dim</td><td><code>number</code></td><td><p>The index at which to insert the singleton dimension</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+unsqueeze_" class="group"></a> <h3 class="relative group"><a id="tensorunsqueeze--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorunsqueeze--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.unsqueeze_() : Tensor</span></h3> <p data-svelte-h="svelte-1b9ygao">In-place version of @see <a href="Tensor.unsqueeze">Tensor.unsqueeze</a></p> <p data-svelte-h="svelte-1mr58c3"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+flatten_" class="group"></a> <h3 class="relative group"><a id="tensorflatten" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorflatten"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.flatten_()</span></h3> <p data-svelte-h="svelte-1vkr5xo">In-place version of @see <a href="Tensor.flatten">Tensor.flatten</a></p> <p data-svelte-h="svelte-1mr58c3"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+flatten" class="group"></a> <h3 class="relative group"><a id="tensorflattenstartdim-enddim--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorflattenstartdim-enddim--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.flatten(start_dim, end_dim) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1gguudf">Flattens input by reshaping it into a one-dimensional tensor.
If <code>start_dim</code> or <code>end_dim</code> are passed, only dimensions starting with <code>start_dim</code>
and ending with <code>end_dim</code> are flattened. The order of elements in input is unchanged.</p> <p data-svelte-h="svelte-1vf2xxu"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The flattened tensor.</p> <table data-svelte-h="svelte-z6whez"><thead><tr><th>Param</th><th>Type</th><th>Default</th><th>Description</th></tr></thead> <tbody><tr><td>start_dim</td><td><code>number</code></td><td><code>0</code></td><td><p>the first dim to flatten</p></td> </tr><tr><td>end_dim</td><td><code>number</code></td><td></td><td><p>the last dim to flatten</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+view" class="group"></a> <h3 class="relative group"><a id="tensorviewdims--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorviewdims--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.view(...dims) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-d6gvut">Returns a new tensor with the same data as the <code>self</code> tensor but of a different <code>shape</code>.</p> <p data-svelte-h="svelte-1ueenyl"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The tensor with the same data but different shape</p> <table data-svelte-h="svelte-jj58dd"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>...dims</td><td><code>number</code></td><td><p>the desired size</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+gt" class="group"></a> <h3 class="relative group"><a id="tensorgtval--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorgtval--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.gt(val) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1tydf2w">Computes input &gt; val element-wise.</p> <p data-svelte-h="svelte-m0druy"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - A boolean tensor that is <code>true</code> where input is greater than other and <code>false</code> elsewhere.</p> <table data-svelte-h="svelte-nwcu77"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>val</td><td><code>number</code></td><td><p>The value to compare with.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+lt" class="group"></a> <h3 class="relative group"><a id="tensorltval--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorltval--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.lt(val) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-j2lp5o">Computes input &lt; val element-wise.</p> <p data-svelte-h="svelte-b96ihv"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - A boolean tensor that is <code>true</code> where input is less than other and <code>false</code> elsewhere.</p> <table data-svelte-h="svelte-nwcu77"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>val</td><td><code>number</code></td><td><p>The value to compare with.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+clamp_" class="group"></a> <h3 class="relative group"><a id="tensorclamp--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorclamp--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.clamp_() : Tensor</span></h3> <p data-svelte-h="svelte-1adolpg">In-place version of @see <a href="Tensor.clamp">Tensor.clamp</a></p> <p data-svelte-h="svelte-1mr58c3"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+clamp" class="group"></a> <h3 class="relative group"><a id="tensorclampmin-max--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorclampmin-max--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.clamp(min, max) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1hm8vtj">Clamps all elements in input into the range [ min, max ]</p> <p data-svelte-h="svelte-1mnx14"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - the output tensor.</p> <table data-svelte-h="svelte-9ff0sy"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>min</td><td><code>number</code></td><td><p>lower-bound of the range to be clamped to</p></td> </tr><tr><td>max</td><td><code>number</code></td><td><p>upper-bound of the range to be clamped to</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+round_" class="group"></a> <h3 class="relative group"><a id="tensorround" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorround"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.round_()</span></h3> <p data-svelte-h="svelte-1e6kzks">In-place version of @see <a href="Tensor.round">Tensor.round</a></p> <p data-svelte-h="svelte-1mr58c3"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a></p> <hr> <a id="module_utils/tensor.Tensor+round" class="group"></a> <h3 class="relative group"><a id="tensorround--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorround--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.round() ⇒ Tensor</span></h3> <p data-svelte-h="svelte-t5k6jp">Rounds elements of input to the nearest integer.</p> <p data-svelte-h="svelte-1mnx14"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - the output tensor.</p> <hr> <a id="module_utils/tensor.Tensor+repeat" class="group"></a> <h3 class="relative group"><a id="tensorrepeatrepeats--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensorrepeatrepeats--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.repeat(...repeats) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-1odz2y0">Repeats this tensor along the specified dimensions.</p> <p data-svelte-h="svelte-17obchp"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The repeated tensor.<br> <strong>Throws</strong>:</p> <ul data-svelte-h="svelte-8jcig4"><li><code>Error</code> If the number of repeats is less than the number of dimensions.</li></ul> <table data-svelte-h="svelte-1dgg1iy"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>...repeats</td><td><code>number</code></td><td><p>The number of times to repeat this tensor along each dimension.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+tile" class="group"></a> <h3 class="relative group"><a id="tensortiledims--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensortiledims--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.tile(...dims) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-278726">Constructs a tensor by repeating the elements of input. The dims argument specifies the number of repetitions in each dimension.</p> <p data-svelte-h="svelte-11gbanx"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The tiled tensor.</p> <table data-svelte-h="svelte-1lactrr"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>...dims</td><td><code>number</code></td><td><p>The number of repetitions per dimension.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.Tensor+to" class="group"></a> <h3 class="relative group"><a id="tensortotype--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#tensortotype--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>tensor.to(type) ⇒ Tensor</span></h3> <p data-svelte-h="svelte-avw2a1">Performs Tensor dtype conversion.</p> <p data-svelte-h="svelte-3w87vv"><strong>Kind</strong>: instance method of <a href="#module_utils/tensor.Tensor"><code>Tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The converted tensor.</p> <table data-svelte-h="svelte-jj5vaa"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>type</td><td><code><a href="#DataType">DataType</a></code></td><td><p>The desired data type.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.permute" class="group"></a> <h2 class="relative group"><a id="utilstensorpermutetensor-axes--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorpermutetensor-axes--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.permute(tensor, axes) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-167n5bd">Permutes a tensor according to the provided axes.</p> <p data-svelte-h="svelte-74oixn"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The permuted tensor.</p> <table data-svelte-h="svelte-1oyadc3"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>tensor</td><td><code>any</code></td><td><p>The input tensor to permute.</p></td> </tr><tr><td>axes</td><td><code>Array</code></td><td><p>The axes to permute the tensor along.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.interpolate" class="group"></a> <h2 class="relative group"><a id="utilstensorinterpolateinput-size-mode-aligncorners--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorinterpolateinput-size-mode-aligncorners--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.interpolate(input, size, mode, align_corners) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-fju8tm">Interpolates an Tensor to the given size.</p> <p data-svelte-h="svelte-16503uw"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The interpolated tensor.</p> <table data-svelte-h="svelte-1lujpah"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>input</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>The input tensor to interpolate. Data must be channel-first (i.e., [c, h, w])</p></td> </tr><tr><td>size</td><td><code>Array</code></td><td><p>The output size of the image</p></td> </tr><tr><td>mode</td><td><code>string</code></td><td><p>The interpolation mode</p></td> </tr><tr><td>align_corners</td><td><code>boolean</code></td><td><p>Whether to align corners.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.interpolate_4d" class="group"></a> <h2 class="relative group"><a id="utilstensorinterpolate4dinput-options--promise--tensor-" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorinterpolate4dinput-options--promise--tensor-"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.interpolate_4d(input, options) ⇒ Promise. &lt; Tensor ></span></h2> <p data-svelte-h="svelte-18v04la">Down/up samples the input.
Inspired by <a href="https://pytorch.org/docs/stable/generated/torch.nn.functional.interpolate.html" rel="nofollow">https://pytorch.org/docs/stable/generated/torch.nn.functional.interpolate.html</a>.</p> <p data-svelte-h="svelte-14kv4rj"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Promise.&lt;Tensor&gt;</code></a> - The interpolated tensor.</p> <table data-svelte-h="svelte-wj1jza"><thead><tr><th>Param</th><th>Type</th><th>Default</th><th>Description</th></tr></thead> <tbody><tr><td>input</td><td><code><a href="#Tensor">Tensor</a></code></td><td></td><td><p>the input tensor</p></td> </tr><tr><td>options</td><td><code>Object</code></td><td></td><td><p>the options for the interpolation</p></td> </tr><tr><td>[options.size]</td><td><code>Array</code> | <code>Array</code> | <code>Array</code></td><td><code></code></td><td><p>output spatial size.</p></td> </tr><tr><td>[options.mode]</td><td><code>&quot;nearest&quot;</code> | <code>&quot;bilinear&quot;</code> | <code>&quot;bicubic&quot;</code></td><td><code>&#39;bilinear&#39;</code></td><td><p>algorithm used for upsampling</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.matmul" class="group"></a> <h2 class="relative group"><a id="utilstensormatmula-b--promise--tensor-" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensormatmula-b--promise--tensor-"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.matmul(a, b) ⇒ Promise. &lt; Tensor ></span></h2> <p data-svelte-h="svelte-1yvow13">Matrix product of two tensors.
Inspired by <a href="https://pytorch.org/docs/stable/generated/torch.matmul.html" rel="nofollow">https://pytorch.org/docs/stable/generated/torch.matmul.html</a></p> <p data-svelte-h="svelte-fexugp"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Promise.&lt;Tensor&gt;</code></a> - The matrix product of the two tensors.</p> <table data-svelte-h="svelte-1t0kp7i"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>a</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>the first tensor to be multiplied</p></td> </tr><tr><td>b</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>the second tensor to be multiplied</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.rfft" class="group"></a> <h2 class="relative group"><a id="utilstensorrfftx-a--promise--tensor-" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorrfftx-a--promise--tensor-"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.rfft(x, a) ⇒ Promise. &lt; Tensor ></span></h2> <p data-svelte-h="svelte-19dtamh">Computes the one dimensional Fourier transform of real-valued input.
Inspired by <a href="https://pytorch.org/docs/stable/generated/torch.fft.rfft.html" rel="nofollow">https://pytorch.org/docs/stable/generated/torch.fft.rfft.html</a></p> <p data-svelte-h="svelte-1q9jl83"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Promise.&lt;Tensor&gt;</code></a> - the output tensor.</p> <table data-svelte-h="svelte-po861j"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>x</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>the real input tensor</p></td> </tr><tr><td>a</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>The dimension along which to take the one dimensional real FFT.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.topk" class="group"></a> <h2 class="relative group"><a id="utilstensortopkx-k--promise--array-" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensortopkx-k--promise--array-"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.topk(x, [k]) ⇒ Promise. &lt; Array ></span></h2> <p data-svelte-h="svelte-bd7moq">Returns the k largest elements of the given input tensor.
Inspired by <a href="https://pytorch.org/docs/stable/generated/torch.topk.html" rel="nofollow">https://pytorch.org/docs/stable/generated/torch.topk.html</a></p> <p data-svelte-h="svelte-uil1wq"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <code>Promise.&lt;Array&gt;</code> - the output tuple of (Tensor, LongTensor) of top-k elements and their indices.</p> <table data-svelte-h="svelte-15nix8z"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>x</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>the input tensor</p></td> </tr><tr><td>[k]</td><td><code>number</code></td><td><p>the k in &quot;top-k&quot;</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.slice" class="group"></a> <h2 class="relative group"><a id="utilstensorslicedata-starts-ends-axes-steps--promise--tensor-" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorslicedata-starts-ends-axes-steps--promise--tensor-"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.slice(data:, starts:, ends:, axes:, [steps]) ⇒ Promise. &lt; Tensor ></span></h2> <p data-svelte-h="svelte-9z0ni1">Slice a multidimensional float32 tensor.</p> <p data-svelte-h="svelte-av0ptf"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Promise.&lt;Tensor&gt;</code></a> - Sliced data tensor.</p> <table data-svelte-h="svelte-9bs0s1"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>data:</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>Tensor of data to extract slices from</p></td> </tr><tr><td>starts:</td><td><code>Array</code></td><td><p>1-D array of starting indices of corresponding axis in axes</p></td> </tr><tr><td>ends:</td><td><code>Array</code></td><td><p>1-D array of ending indices (exclusive) of corresponding axis in axes</p></td> </tr><tr><td>axes:</td><td><code>Array</code></td><td><p>1-D array of axes that starts and ends apply to</p></td> </tr><tr><td>[steps]</td><td><code>Array</code></td><td><p>1-D array of slice step of corresponding axis in axes.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.mean_pooling" class="group"></a> <h2 class="relative group"><a id="utilstensormeanpoolinglasthiddenstate-attentionmask--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensormeanpoolinglasthiddenstate-attentionmask--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.mean_pooling(last_hidden_state, attention_mask) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-11ei68w">Perform mean pooling of the last hidden state followed by a normalization step.</p> <p data-svelte-h="svelte-f0cseu"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - Returns a new Tensor of shape [batchSize, embedDim].</p> <table data-svelte-h="svelte-1lgev2y"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>last_hidden_state</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>Tensor of shape [batchSize, seqLength, embedDim]</p></td> </tr><tr><td>attention_mask</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>Tensor of shape [batchSize, seqLength]</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.layer_norm" class="group"></a> <h2 class="relative group"><a id="utilstensorlayernorminput-normalizedshape-options--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorlayernorminput-normalizedshape-options--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.layer_norm(input, normalized_shape, options) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-7ivim4">Apply Layer Normalization for last certain number of dimensions.</p> <p data-svelte-h="svelte-1t7ypd0"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The normalized tensor.</p> <table data-svelte-h="svelte-1uazdlx"><thead><tr><th>Param</th><th>Type</th><th>Default</th><th>Description</th></tr></thead> <tbody><tr><td>input</td><td><code><a href="#Tensor">Tensor</a></code></td><td></td><td><p>The input tensor</p></td> </tr><tr><td>normalized_shape</td><td><code>Array</code></td><td></td><td><p>input shape from an expected input of size</p></td> </tr><tr><td>options</td><td><code>Object</code></td><td></td><td><p>The options for the layer normalization</p></td> </tr><tr><td>[options.eps]</td><td><code>number</code></td><td><code>1e-5</code></td><td><p>A value added to the denominator for numerical stability.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.cat" class="group"></a> <h2 class="relative group"><a id="utilstensorcattensors-dim--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorcattensors-dim--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.cat(tensors, dim) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-k6p1db">Concatenates an array of tensors along a specified dimension.</p> <p data-svelte-h="svelte-6qi3ne"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The concatenated tensor.</p> <table data-svelte-h="svelte-17rez1y"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>tensors</td><td><code>Array</code></td><td><p>The array of tensors to concatenate.</p></td> </tr><tr><td>dim</td><td><code>number</code></td><td><p>The dimension to concatenate along.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.stack" class="group"></a> <h2 class="relative group"><a id="utilstensorstacktensors-dim--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorstacktensors-dim--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.stack(tensors, dim) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-8afo9v">Stack an array of tensors along a specified dimension.</p> <p data-svelte-h="svelte-fnpm0s"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The stacked tensor.</p> <table data-svelte-h="svelte-1j9l4g0"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>tensors</td><td><code>Array</code></td><td><p>The array of tensors to stack.</p></td> </tr><tr><td>dim</td><td><code>number</code></td><td><p>The dimension to stack along.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.std_mean" class="group"></a> <h2 class="relative group"><a id="utilstensorstdmeaninput-dim-correction-keepdim--array" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorstdmeaninput-dim-correction-keepdim--array"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.std_mean(input, dim, correction, keepdim) ⇒ Array</span></h2> <p data-svelte-h="svelte-11plveb">Calculates the standard deviation and mean over the dimensions specified by dim. dim can be a single dimension or <code>null</code> to reduce over all dimensions.</p> <p data-svelte-h="svelte-1mqyc8h"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <code>Array</code> - A tuple of (std, mean) tensors.</p> <table data-svelte-h="svelte-xda5g6"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>input</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>the input tenso</p></td> </tr><tr><td>dim</td><td><code>number</code> | <code>null</code></td><td><p>the dimension to reduce. If None, all dimensions are reduced.</p></td> </tr><tr><td>correction</td><td><code>number</code></td><td><p>difference between the sample size and sample degrees of freedom. Defaults to Bessel&#39;s correction, correction=1.</p></td> </tr><tr><td>keepdim</td><td><code>boolean</code></td><td><p>whether the output tensor has dim retained or not.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.mean" class="group"></a> <h2 class="relative group"><a id="utilstensormeaninput-dim-keepdim--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensormeaninput-dim-keepdim--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.mean(input, dim, keepdim) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-17f4oxi">Returns the mean value of each row of the input tensor in the given dimension dim.</p> <p data-svelte-h="svelte-j8mnym"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - A new tensor with means taken along the specified dimension.</p> <table data-svelte-h="svelte-8q2rcx"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>input</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>the input tensor.</p></td> </tr><tr><td>dim</td><td><code>number</code> | <code>null</code></td><td><p>the dimension to reduce.</p></td> </tr><tr><td>keepdim</td><td><code>boolean</code></td><td><p>whether the output tensor has dim retained or not.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.full" class="group"></a> <h2 class="relative group"><a id="utilstensorfullsize-fillvalue--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorfullsize-fillvalue--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.full(size, fill_value) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-10qu7f7">Creates a tensor of size size filled with fill_value. The tensor’s dtype is inferred from fill_value.</p> <p data-svelte-h="svelte-18rka45"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The filled tensor.</p> <table data-svelte-h="svelte-ipxxe9"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>size</td><td><code>Array</code></td><td><p>A sequence of integers defining the shape of the output tensor.</p></td> </tr><tr><td>fill_value</td><td><code>number</code> | <code>bigint</code> | <code>boolean</code></td><td><p>The value to fill the output tensor with.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.ones" class="group"></a> <h2 class="relative group"><a id="utilstensoronessize--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensoronessize--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.ones(size) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-1ayje0f">Returns a tensor filled with the scalar value 1, with the shape defined by the variable argument size.</p> <p data-svelte-h="svelte-154ckak"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The ones tensor.</p> <table data-svelte-h="svelte-1uyqs7t"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>size</td><td><code>Array</code></td><td><p>A sequence of integers defining the shape of the output tensor.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.ones_like" class="group"></a> <h2 class="relative group"><a id="utilstensoronesliketensor--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensoronesliketensor--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.ones_like(tensor) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-1wvb8sq">Returns a tensor filled with the scalar value 1, with the same size as input.</p> <p data-svelte-h="svelte-154ckak"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The ones tensor.</p> <table data-svelte-h="svelte-esxgyf"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>tensor</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>The size of input will determine size of the output tensor.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.zeros" class="group"></a> <h2 class="relative group"><a id="utilstensorzerossize--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorzerossize--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.zeros(size) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-1798kaw">Returns a tensor filled with the scalar value 0, with the shape defined by the variable argument size.</p> <p data-svelte-h="svelte-ue1j5m"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The zeros tensor.</p> <table data-svelte-h="svelte-1uyqs7t"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>size</td><td><code>Array</code></td><td><p>A sequence of integers defining the shape of the output tensor.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.zeros_like" class="group"></a> <h2 class="relative group"><a id="utilstensorzerosliketensor--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorzerosliketensor--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.zeros_like(tensor) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-9nnpip">Returns a tensor filled with the scalar value 0, with the same size as input.</p> <p data-svelte-h="svelte-ue1j5m"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The zeros tensor.</p> <table data-svelte-h="svelte-esxgyf"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>tensor</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>The size of input will determine size of the output tensor.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.rand" class="group"></a> <h2 class="relative group"><a id="utilstensorrandsize--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorrandsize--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.rand(size) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-106iz9p">Returns a tensor filled with random numbers from a uniform distribution on the interval [0, 1)</p> <p data-svelte-h="svelte-1uu5d6"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The random tensor.</p> <table data-svelte-h="svelte-1uyqs7t"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>size</td><td><code>Array</code></td><td><p>A sequence of integers defining the shape of the output tensor.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.randn" class="group"></a> <h2 class="relative group"><a id="utilstensorrandnsize--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorrandnsize--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.randn(size) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-m7g8n2">Returns a tensor filled with random numbers from a normal distribution with mean 0 and variance 1 (also called the standard normal distribution).</p> <p data-svelte-h="svelte-1uu5d6"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The random tensor.</p> <table data-svelte-h="svelte-1uyqs7t"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>size</td><td><code>Array</code></td><td><p>A sequence of integers defining the shape of the output tensor.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor.quantize_embeddings" class="group"></a> <h2 class="relative group"><a id="utilstensorquantizeembeddingstensor-precision--tensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorquantizeembeddingstensor-precision--tensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor.quantize_embeddings(tensor, precision) ⇒ Tensor</span></h2> <p data-svelte-h="svelte-185sm1b">Quantizes the embeddings tensor to binary or unsigned binary precision.</p> <p data-svelte-h="svelte-1a5fo0"><strong>Kind</strong>: static method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <a href="#Tensor"><code>Tensor</code></a> - The quantized tensor.</p> <table data-svelte-h="svelte-rf6ukr"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>tensor</td><td><code><a href="#Tensor">Tensor</a></code></td><td><p>The tensor to quantize.</p></td> </tr><tr><td>precision</td><td><code>&#39;binary&#39;</code> | <code>&#39;ubinary&#39;</code></td><td><p>The precision to use for quantization.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor..args[0]" class="group"></a> <h2 class="relative group"><a id="utilstensorargs0--onnxtensor" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorargs0--onnxtensor"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor~args[0] : ONNXTensor</span></h2> <p data-svelte-h="svelte-12loz97"><strong>Kind</strong>: inner property of <a href="#module_utils/tensor"><code>utils/tensor</code></a></p> <hr> <a id="module_utils/tensor..reshape" class="group"></a> <h2 class="relative group"><a id="utilstensorreshapedata-dimensions--nestarray--t-dim-" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorreshapedata-dimensions--nestarray--t-dim-"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor~reshape(data, dimensions) ⇒ NestArray. &lt; T, DIM ></span></h2> <p data-svelte-h="svelte-40isdg">Reshapes a 1-dimensional array into an n-dimensional array, according to the provided dimensions.</p> <p data-svelte-h="svelte-1oq9yme"><strong>Kind</strong>: inner method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <code>NestArray.&lt;T, DIM&gt;</code> - The reshaped array.</p> <table data-svelte-h="svelte-mq435l"><thead><tr><th>Param</th><th>Type</th><th>Description</th></tr></thead> <tbody><tr><td>data</td><td><code>Array</code> | <code>DataArray</code></td><td><p>The input array to reshape.</p></td> </tr><tr><td>dimensions</td><td><code>DIM</code></td><td><p>The target shape/dimensions.</p></td></tr></tbody></table> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-title function_">reshape</span>([<span class="hljs-number">10</span> ], [<span class="hljs-number">1</span> ]); <span class="hljs-comment">// Type: number[] Value: [10]</span>
<span class="hljs-title function_">reshape</span>([<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span> ], [<span class="hljs-number">2</span>, <span class="hljs-number">2</span> ]); <span class="hljs-comment">// Type: number[][] Value: [[1, 2], [3, 4]]</span>
<span class="hljs-title function_">reshape</span>([<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>], [<span class="hljs-number">2</span>, <span class="hljs-number">2</span>, <span class="hljs-number">2</span>]); <span class="hljs-comment">// Type: number[][][] Value: [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]</span>
<span class="hljs-title function_">reshape</span>([<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>, <span class="hljs-number">4</span>, <span class="hljs-number">5</span>, <span class="hljs-number">6</span>, <span class="hljs-number">7</span>, <span class="hljs-number">8</span>], [<span class="hljs-number">4</span>, <span class="hljs-number">2</span> ]); <span class="hljs-comment">// Type: number[][] Value: [[1, 2], [3, 4], [5, 6], [7, 8]]</span><!-- HTML_TAG_END --></pre></div> <hr> <a id="module_utils/tensor..reshape..reshapedArray" class="group"></a> <h3 class="relative group"><a id="reshapereshapedarray--any" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#reshapereshapedarray--any"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>reshape~reshapedArray : any</span></h3> <p data-svelte-h="svelte-kp31r8"><strong>Kind</strong>: inner property of <a href="#module_utils/tensor..reshape"><code>reshape</code></a></p> <hr> <a id="module_utils/tensor..reduce_helper" class="group"></a> <h2 class="relative group"><a id="utilstensorreducehelpercallbackfn-input-dim-keepdim-initialvalue--array" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensorreducehelpercallbackfn-input-dim-keepdim-initialvalue--array"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor~reduce_helper(callbackfn, input, dim, keepdim, [initialValue]) ⇒ Array</span></h2> <p data-svelte-h="svelte-1wfxsn2"><strong>Kind</strong>: inner method of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Returns</strong>: <code>Array</code> - The reduced tensor data.</p> <table data-svelte-h="svelte-g2tgid"><thead><tr><th>Param</th><th>Type</th><th>Default</th><th>Description</th></tr></thead> <tbody><tr><td>callbackfn</td><td><code>function</code></td><td></td><td></td> </tr><tr><td>input</td><td><code><a href="#Tensor">Tensor</a></code></td><td></td><td><p>the input tensor.</p></td> </tr><tr><td>dim</td><td><code>number</code></td><td></td><td><p>the dimension to reduce.</p></td> </tr><tr><td>keepdim</td><td><code>boolean</code></td><td><code>false</code></td><td><p>whether the output tensor has dim retained or not.</p></td> </tr><tr><td>[initialValue]</td><td><code>any</code></td><td><code></code></td><td><p>the initial value to start the reduction with.</p></td></tr></tbody></table> <hr> <a id="module_utils/tensor..DataArray" class="group"></a> <h2 class="relative group"><a id="utilstensordataarray--string" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensordataarray--string"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor~DataArray : string</span></h2> <p data-svelte-h="svelte-1fs9no9"><strong>Kind</strong>: inner typedef of <a href="#module_utils/tensor"><code>utils/tensor</code></a></p> <hr> <a id="module_utils/tensor..NestArray" class="group"></a> <h2 class="relative group"><a id="utilstensornestarray--any" class="header-link block pr-1.5 text-lg no-hover:hidden with-hover:absolute with-hover:p-1.5 with-hover:opacity-0 with-hover:group-hover:opacity-100 with-hover:right-full" href="#utilstensornestarray--any"><span><svg class="" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 256"><path d="M167.594 88.393a8.001 8.001 0 0 1 0 11.314l-67.882 67.882a8 8 0 1 1-11.314-11.315l67.882-67.881a8.003 8.003 0 0 1 11.314 0zm-28.287 84.86l-28.284 28.284a40 40 0 0 1-56.567-56.567l28.284-28.284a8 8 0 0 0-11.315-11.315l-28.284 28.284a56 56 0 0 0 79.196 79.197l28.285-28.285a8 8 0 1 0-11.315-11.314zM212.852 43.14a56.002 56.002 0 0 0-79.196 0l-28.284 28.284a8 8 0 1 0 11.314 11.314l28.284-28.284a40 40 0 0 1 56.568 56.567l-28.285 28.285a8 8 0 0 0 11.315 11.314l28.284-28.284a56.065 56.065 0 0 0 0-79.196z" fill="currentColor"></path></svg></span></a> <span>utils/tensor~NestArray : any</span></h2> <p data-svelte-h="svelte-2mif9c">This creates a nested array of a given type and depth (see examples).</p> <p data-svelte-h="svelte-1jas2kw"><strong>Kind</strong>: inner typedef of <a href="#module_utils/tensor"><code>utils/tensor</code></a><br> <strong>Example</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-title class_">NestArray</span>&lt;string, <span class="hljs-number">1</span>&gt;; <span class="hljs-comment">// string[]</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-title class_">NestArray</span>&lt;number, <span class="hljs-number">2</span>&gt;; <span class="hljs-comment">// number[][]</span><!-- HTML_TAG_END --></pre></div> <p data-svelte-h="svelte-1aswmub"><strong>Example</strong></p> <div class="code-block relative "><div class="absolute top-2.5 right-4"><button class="inline-flex items-center relative text-sm focus:text-green-500 cursor-pointer focus:outline-none transition duration-200 ease-in-out opacity-0 mx-0.5 text-gray-600 " title="code excerpt" type="button"><svg class="" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M28,10V28H10V10H28m0-2H10a2,2,0,0,0-2,2V28a2,2,0,0,0,2,2H28a2,2,0,0,0,2-2V10a2,2,0,0,0-2-2Z" transform="translate(0)"></path><path d="M4,18H2V4A2,2,0,0,1,4,2H18V4H4Z" transform="translate(0)"></path><rect fill="none" width="32" height="32"></rect></svg> <div class="absolute pointer-events-none transition-opacity bg-black text-white py-1 px-2 leading-tight rounded font-normal shadow left-1/2 top-full transform -translate-x-1/2 translate-y-2 opacity-0"><div class="absolute bottom-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-black border-4 border-t-0" style="border-left-color: transparent; border-right-color: transparent; "></div> Copied</div></button></div> <pre class=""><!-- HTML_TAG_START --><span class="hljs-title class_">NestArray</span>&lt;string, <span class="hljs-number">3</span>&gt;; <span class="hljs-comment">// string[][][] etc.</span><!-- HTML_TAG_END --></pre></div> <hr> <a class="!text-gray-400 !no-underline text-sm flex items-center not-prose mt-4" href="https://github.com/huggingface/transformers.js/blob/main/packages/transformers/docs/source/api/utils/tensor.md" target="_blank"><svg class="mr-1" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" fill="currentColor" focusable="false" role="img" width="1em" height="1em" preserveAspectRatio="xMidYMid meet" viewBox="0 0 32 32"><path d="M31,16l-7,7l-1.41-1.41L28.17,16l-5.58-5.59L24,9l7,7z"></path><path d="M1,16l7-7l1.41,1.41L3.83,16l5.58,5.59L8,23l-7-7z"></path><path d="M12.419,25.484L17.639,6.552l1.932,0.518L14.351,26.002z"></path></svg> <span data-svelte-h="svelte-zjs2n5"><span class="underline">Update</span> on GitHub</span></a> <p></p>
<script>
{
__sveltekit_rvrl7f = {
assets: "/docs/transformers.js/pr_1649/en",
base: "/docs/transformers.js/pr_1649/en",
env: {}
};
const element = document.currentScript.parentElement;
const data = [null,null];
Promise.all([
import("/docs/transformers.js/pr_1649/en/_app/immutable/entry/start.5f753a22.js"),
import("/docs/transformers.js/pr_1649/en/_app/immutable/entry/app.db3dfcb7.js")
]).then(([kit, app]) => {
kit.start(app, element, {
node_ids: [0, 24],
data,
form: null,
error: null
});
});
}
</script>

Xet Storage Details

Size:
195 kB
·
Xet hash:
25609151fbbb2a3b70601079a473101edb7fdc7edfdc4c609bd1d5be06ad9b65

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.