Skip to main content
Version: Next

Interface: Tensor

torchlive/torch.Tensor

Indexable

[index: number]: Tensor

Access tensor with index.

const tensor = torch.rand([2]);
console.log(tensor.data, tensor[0].data);
// [0.8339180946350098, 0.17733973264694214], [0.8339180946350098]

https://pytorch.org/cppdocs/notes/tensor_indexing.html

Properties

dtype

dtype: Dtype

A dtype is an string that represents the data type of a torch.Tensor.

https://pytorch.org/docs/1.12/tensor_attributes.html


shape

shape: number[]

Returns the size of the tensor.

https://pytorch.org/docs/1.12/generated/torch.Tensor.size.html

Methods

_And_

And(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.and.html

Parameters

NameType
othernumber

Returns

Tensor

And(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


_Lshift_

Lshift(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.lshift.html

Parameters

NameType
othernumber

Returns

Tensor

Lshift(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


_Or_

Or(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.or.html

Parameters

NameType
othernumber

Returns

Tensor

Or(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


_Rshift_

Rshift(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.rshift.html

Parameters

NameType
othernumber

Returns

Tensor

Rshift(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


_Xor_

Xor(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.xor.html

Parameters

NameType
othernumber

Returns

Tensor

Xor(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


_addmmActivation

_addmmActivation(mat1, mat2, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor._addmm_activation.html

Parameters

NameType
mat1Tensor
mat2Tensor
options?Object
options.alpha?Number
options.beta?Number
options.useGelu?boolean

Returns

Tensor


_conj

_conj(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor._conj.html

Returns

Tensor


_conjPhysical

_conjPhysical(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor._conj_physical.html

Returns

Tensor


_fwPrimal

_fwPrimal(level): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor._fw_primal.html

Parameters

NameType
levelnumber

Returns

Tensor


_indices

_indices(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor._indices.html

Returns

Tensor


_negView

_negView(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor._neg_view.html

Returns

Tensor


_nestedTensorSize

_nestedTensorSize(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor._nested_tensor_size.html

Returns

Tensor


_nestedTensorStrides

_nestedTensorStrides(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor._nested_tensor_strides.html

Returns

Tensor


_reshapeAlias

_reshapeAlias(size, stride): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor._reshape_alias.html

Parameters

NameType
sizenumber[]
stridenumber[]

Returns

Tensor


_values

_values(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor._values.html

Returns

Tensor


abs

abs(): Tensor

Computes the absolute value of each element in input.

https://pytorch.org/docs/1.12/generated/torch.Tensor.abs.html

Returns

Tensor


absolute

absolute(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.absolute.html

Returns

Tensor


acos

acos(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.acos.html

Returns

Tensor


acosh

acosh(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.acosh.html

Returns

Tensor


add

add(other, options?): Tensor

Add a scalar or tensor to this tensor.

https://pytorch.org/docs/1.12/generated/torch.Tensor.add.html

Parameters

NameTypeDescription
othernumber | TensorScalar or tensor to be added to each element in this tensor.
options?Object-
options.alpha?NumberThe multiplier for other. Default: 1.

Returns

Tensor


addbmm

addbmm(batch1, batch2, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.addbmm.html

Parameters

NameType
batch1Tensor
batch2Tensor
options?Object
options.alpha?Number
options.beta?Number

Returns

Tensor


addcdiv

addcdiv(tensor1, tensor2, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.addcdiv.html

Parameters

NameType
tensor1Tensor
tensor2Tensor
options?Object
options.value?Number

Returns

Tensor


addcmul

addcmul(tensor1, tensor2, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.addcmul.html

Parameters

NameType
tensor1Tensor
tensor2Tensor
options?Object
options.value?Number

Returns

Tensor


addmm

addmm(mat1, mat2, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.addmm.html

Parameters

NameType
mat1Tensor
mat2Tensor
options?Object
options.alpha?Number
options.beta?Number

Returns

Tensor


addmv

addmv(mat, vec, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.addmv.html

Parameters

NameType
matTensor
vecTensor
options?Object
options.alpha?Number
options.beta?Number

Returns

Tensor


addr

addr(vec1, vec2, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.addr.html

Parameters

NameType
vec1Tensor
vec2Tensor
options?Object
options.alpha?Number
options.beta?Number

Returns

Tensor


adjoint

adjoint(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.adjoint.html

Returns

Tensor


alias

alias(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.alias.html

Returns

Tensor


alignAs

alignAs(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.align_as.html

Parameters

NameType
otherTensor

Returns

Tensor


aminmax

aminmax(options?): [Tensor, Tensor]

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.aminmax.html

Parameters

NameType
options?Object
options.dim?number
options.keepdim?boolean

Returns

[Tensor, Tensor]


angle

angle(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.angle.html

Returns

Tensor


arccos

arccos(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.arccos.html

Returns

Tensor


arccosh

arccosh(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.arccosh.html

Returns

Tensor


arcsin

arcsin(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.arcsin.html

Returns

Tensor


arcsinh

arcsinh(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.arcsinh.html

Returns

Tensor


arctan

arctan(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.arctan.html

Returns

Tensor


arctan2

arctan2(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.arctan2.html

Parameters

NameType
otherTensor

Returns

Tensor


arctanh

arctanh(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.arctanh.html

Returns

Tensor


argmax

argmax(options?): Tensor

Returns the indices of the maximum value of all elements in the input tensor.

https://pytorch.org/docs/1.12/generated/torch.Tensor.argmax.html

Parameters

NameTypeDescription
options?Objectargmax Options as keywords argument in pytorch
options.dim?numberThe dimension to reduce. If undefined, the argmax of the flattened input is returned.
options.keepdim?booleanWhether the output tensor has dim retained or not. Ignored if dim is undefined.

Returns

Tensor


argmin

argmin(options?): Tensor

Returns the indices of the minimum value(s) of the flattened tensor or along a dimension

https://pytorch.org/docs/1.12/generated/torch.Tensor.argmin.html

Parameters

NameTypeDescription
options?Objectargmin Options as keywords argument in pytorch
options.dim?numberThe dimension to reduce. If undefined, the argmin of the flattened input is returned.
options.keepdim?booleanWhether the output tensor has dim retained or not. Ignored if dim is undefined.

Returns

Tensor


argwhere

argwhere(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.argwhere.html

Returns

Tensor


asStrided

asStrided(size, stride, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.as_strided.html

Parameters

NameType
sizenumber[]
stridenumber[]
options?Object
options.storageOffset?number

Returns

Tensor


asStridedScatter

asStridedScatter(src, size, stride, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.as_strided_scatter.html

Parameters

NameType
srcTensor
sizenumber[]
stridenumber[]
options?Object
options.storageOffset?number

Returns

Tensor


asin

asin(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.asin.html

Returns

Tensor


asinh

asinh(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.asinh.html

Returns

Tensor


atan

atan(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.atan.html

Returns

Tensor


atan2

atan2(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.atan2.html

Parameters

NameType
otherTensor

Returns

Tensor


atanh

atanh(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.atanh.html

Returns

Tensor


baddbmm

baddbmm(batch1, batch2, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.baddbmm.html

Parameters

NameType
batch1Tensor
batch2Tensor
options?Object
options.alpha?Number
options.beta?Number

Returns

Tensor


bitwiseAnd

bitwiseAnd(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_and.html

Parameters

NameType
othernumber

Returns

Tensor

bitwiseAnd(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


bitwiseLeftShift

bitwiseLeftShift(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_left_shift.html

Parameters

NameType
otherTensor

Returns

Tensor

bitwiseLeftShift(other): Tensor

Parameters

NameType
othernumber

Returns

Tensor


bitwiseNot

bitwiseNot(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_not.html

Returns

Tensor


bitwiseOr

bitwiseOr(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_or.html

Parameters

NameType
othernumber

Returns

Tensor

bitwiseOr(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


bitwiseRightShift

bitwiseRightShift(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_right_shift.html

Parameters

NameType
otherTensor

Returns

Tensor

bitwiseRightShift(other): Tensor

Parameters

NameType
othernumber

Returns

Tensor


bitwiseXor

bitwiseXor(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_xor.html

Parameters

NameType
othernumber

Returns

Tensor

bitwiseXor(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


bmm

bmm(mat2): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.bmm.html

Parameters

NameType
mat2Tensor

Returns

Tensor


broadcastTo

broadcastTo(size): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.broadcast_to.html

Parameters

NameType
sizenumber[]

Returns

Tensor


ccolIndices

ccolIndices(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.ccol_indices.html

Returns

Tensor


ceil

ceil(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.ceil.html

Returns

Tensor


cholesky

cholesky(options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.cholesky.html

Parameters

NameType
options?Object
options.upper?boolean

Returns

Tensor


choleskyInverse

choleskyInverse(options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.cholesky_inverse.html

Parameters

NameType
options?Object
options.upper?boolean

Returns

Tensor


choleskySolve

choleskySolve(input2, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.cholesky_solve.html

Parameters

NameType
input2Tensor
options?Object
options.upper?boolean

Returns

Tensor


clamp

clamp(min, max?): Tensor

Clamps all elements in input into the range [ min, max ].

If min is undefined, there is no lower bound. Or, if max is undefined there is no upper bound.

https://pytorch.org/docs/1.12/generated/torch.Tensor.clamp.html

Parameters

NameTypeDescription
minnumber | TensorLower-bound of the range to be clamped to
max?number | TensorUpper-bound of the range to be clamped to

Returns

Tensor

clamp(options): Tensor

Clamps all elements in input into the range [ min, max ].

If min is undefined, there is no lower bound. Or, if max is undefined there is no upper bound.

https://pytorch.org/docs/1.12/generated/torch.Tensor.clamp.html

Parameters

NameTypeDescription
optionsObject-
options.max?number | TensorUpper-bound of the range to be clamped to
options.min?number | TensorLower-bound of the range to be clamped to

Returns

Tensor


clampMax

clampMax(max): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.clamp_max.html

Parameters

NameType
maxnumber

Returns

Tensor

clampMax(max): Tensor

Parameters

NameType
maxTensor

Returns

Tensor


clampMin

clampMin(min): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.clamp_min.html

Parameters

NameType
minnumber

Returns

Tensor

clampMin(min): Tensor

Parameters

NameType
minTensor

Returns

Tensor


coalesce

coalesce(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.coalesce.html

Returns

Tensor


colIndices

colIndices(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.col_indices.html

Returns

Tensor


conj

conj(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.conj.html

Returns

Tensor


conjPhysical

conjPhysical(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.conj_physical.html

Returns

Tensor


contiguous

contiguous(options?): Tensor

Returns a contiguous in memory tensor containing the same data as this tensor. If this tensor is already in the specified memory format, this function returns this tensor.

Parameters

NameTypeDescription
options?Object-
options.memoryFormatMemoryFormatThe desired memory format of returned Tensor. Default: torch.contiguousFormat. https://pytorch.org/docs/1.12/generated/torch.Tensor.contiguous.html

Returns

Tensor


copysign

copysign(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.copysign.html

Parameters

NameType
otherTensor

Returns

Tensor

copysign(other): Tensor

Parameters

NameType
othernumber

Returns

Tensor


corrcoef

corrcoef(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.corrcoef.html

Returns

Tensor


cos

cos(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.cos.html

Returns

Tensor


cosh

cosh(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.cosh.html

Returns

Tensor


countNonzero

countNonzero(dim): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.count_nonzero.html

Parameters

NameType
dimnumber[]

Returns

Tensor

countNonzero(options?): Tensor

Parameters

NameType
options?Object
options.dim?number

Returns

Tensor


cross

cross(other, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.cross.html

Parameters

NameType
otherTensor
options?Object
options.dim?number

Returns

Tensor


crowIndices

crowIndices(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.crow_indices.html

Returns

Tensor


data

data(): TypedArray

Returns the tensor data as TypedArray buffer.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray

A valid TypeScript expression is as follows:

torch.rand([2, 3]).data()[3];
note

The function only exists in JavaScript.

experimental

Returns

TypedArray


deg2rad

deg2rad(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.deg2rad.html

Returns

Tensor


dequantize

dequantize(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.dequantize.html

Returns

Tensor


det

det(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.det.html

Returns

Tensor


detach

detach(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.detach.html

Returns

Tensor


diag

diag(options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.diag.html

Parameters

NameType
options?Object
options.diagonal?number

Returns

Tensor


diagEmbed

diagEmbed(options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.diag_embed.html

Parameters

NameType
options?Object
options.dim1?number
options.dim2?number
options.offset?number

Returns

Tensor


diagflat

diagflat(options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.diagflat.html

Parameters

NameType
options?Object
options.offset?number

Returns

Tensor


diagonalScatter

diagonalScatter(src, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.diagonal_scatter.html

Parameters

NameType
srcTensor
options?Object
options.dim1?number
options.dim2?number
options.offset?number

Returns

Tensor


digamma

digamma(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.digamma.html

Returns

Tensor


dist

dist(other, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.dist.html

Parameters

NameType
otherTensor
options?Object
options.p?Number

Returns

Tensor


div

div(other, options?): Tensor

Divides each element of the input input by the corresponding element of other.

https://pytorch.org/docs/1.12/generated/torch.Tensor.div.html

Parameters

NameTypeDescription
othernumber | TensorScalar or tensor that divides each element in this tensor.
options?Object-
options.roundingMode?"trunc" | "floor"Type of rounding applied to the result

Returns

Tensor


dot

dot(tensor): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.dot.html

Parameters

NameType
tensorTensor

Returns

Tensor


eq

eq(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.eq.html

Parameters

NameType
othernumber

Returns

Tensor

eq(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


erf

erf(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.erf.html

Returns

Tensor


erfc

erfc(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.erfc.html

Returns

Tensor


erfinv

erfinv(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.erfinv.html

Returns

Tensor


exp

exp(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.exp.html

Returns

Tensor


exp2

exp2(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.exp2.html

Returns

Tensor


expand

expand(sizes): Tensor

Returns a new view of the tensor expanded to a larger size.

https://pytorch.org/docs/stable/generated/torch.Tensor.expand.html

Parameters

NameTypeDescription
sizesnumber[]The expanded size, eg: ([3, 4]).

Returns

Tensor


expandAs

expandAs(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.expand_as.html

Parameters

NameType
otherTensor

Returns

Tensor


expm1

expm1(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.expm1.html

Returns

Tensor


fix

fix(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.fix.html

Returns

Tensor


flip

flip(dims): Tensor

Reverse the order of a n-D tensor along given axis in dims.

https://pytorch.org/docs/1.12/generated/torch.Tensor.flip.html

Parameters

NameTypeDescription
dimsnumber[]Axis to flip on.

Returns

Tensor


fliplr

fliplr(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.fliplr.html

Returns

Tensor


flipud

flipud(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.flipud.html

Returns

Tensor


floatPower

floatPower(exponent): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.float_power.html

Parameters

NameType
exponentTensor

Returns

Tensor

floatPower(exponent): Tensor

Parameters

NameType
exponentnumber

Returns

Tensor


floor

floor(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.floor.html

Returns

Tensor


floorDivide

floorDivide(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.floor_divide.html

Parameters

NameType
otherTensor

Returns

Tensor

floorDivide(other): Tensor

Parameters

NameType
othernumber

Returns

Tensor


fmax

fmax(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.fmax.html

Parameters

NameType
otherTensor

Returns

Tensor


fmin

fmin(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.fmin.html

Parameters

NameType
otherTensor

Returns

Tensor


fmod

fmod(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.fmod.html

Parameters

NameType
othernumber

Returns

Tensor

fmod(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


frac

frac(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.frac.html

Returns

Tensor


frexp

frexp(): [Tensor, Tensor]

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.frexp.html

Returns

[Tensor, Tensor]


gcd

gcd(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.gcd.html

Parameters

NameType
otherTensor

Returns

Tensor


ge

ge(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.ge.html

Parameters

NameType
othernumber

Returns

Tensor

ge(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


geqrf

geqrf(): [Tensor, Tensor]

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.geqrf.html

Returns

[Tensor, Tensor]


ger

ger(vec2): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.ger.html

Parameters

NameType
vec2Tensor

Returns

Tensor


greater

greater(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.greater.html

Parameters

NameType
othernumber

Returns

Tensor

greater(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


greaterEqual

greaterEqual(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.greater_equal.html

Parameters

NameType
othernumber

Returns

Tensor

greaterEqual(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


gt

gt(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.gt.html

Parameters

NameType
othernumber

Returns

Tensor

gt(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


hardshrink

hardshrink(options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.hardshrink.html

Parameters

NameType
options?Object
options.lambd?Number

Returns

Tensor


heaviside

heaviside(values): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.heaviside.html

Parameters

NameType
valuesTensor

Returns

Tensor


histc

histc(options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.histc.html

Parameters

NameType
options?Object
options.bins?number
options.max?Number
options.min?Number

Returns

Tensor


hypot

hypot(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.hypot.html

Parameters

NameType
otherTensor

Returns

Tensor


i0

i0(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.i0.html

Returns

Tensor


igamma

igamma(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.igamma.html

Parameters

NameType
otherTensor

Returns

Tensor


igammac

igammac(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.igammac.html

Parameters

NameType
otherTensor

Returns

Tensor


indices

indices(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.indices.html

Returns

Tensor


inner

inner(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.inner.html

Parameters

NameType
otherTensor

Returns

Tensor


intRepr

intRepr(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.int_repr.html

Returns

Tensor


inverse

inverse(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.inverse.html

Returns

Tensor


isfinite

isfinite(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.isfinite.html

Returns

Tensor


isinf

isinf(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.isinf.html

Returns

Tensor


isnan

isnan(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.isnan.html

Returns

Tensor


isneginf

isneginf(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.isneginf.html

Returns

Tensor


isposinf

isposinf(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.isposinf.html

Returns

Tensor


isreal

isreal(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.isreal.html

Returns

Tensor


item

item(): number

Returns the value of this tensor as a number. This only works for tensors with one element.

https://pytorch.org/docs/1.12/generated/torch.Tensor.item.html

Returns

number


kron

kron(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.kron.html

Parameters

NameType
otherTensor

Returns

Tensor


lcm

lcm(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.lcm.html

Parameters

NameType
otherTensor

Returns

Tensor


ldexp

ldexp(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.ldexp.html

Parameters

NameType
otherTensor

Returns

Tensor


le

le(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.le.html

Parameters

NameType
othernumber

Returns

Tensor

le(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


lerp

lerp(end, weight): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.lerp.html

Parameters

NameType
endTensor
weightnumber

Returns

Tensor

lerp(end, weight): Tensor

Parameters

NameType
endTensor
weightTensor

Returns

Tensor


less

less(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.less.html

Parameters

NameType
othernumber

Returns

Tensor

less(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


lessEqual

lessEqual(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.less_equal.html

Parameters

NameType
othernumber

Returns

Tensor

lessEqual(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


lgamma

lgamma(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.lgamma.html

Returns

Tensor


log

log(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.log.html

Returns

Tensor


log10

log10(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.log10.html

Returns

Tensor


log1p

log1p(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.log1p.html

Returns

Tensor


log2

log2(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.log2.html

Returns

Tensor


logaddexp

logaddexp(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.logaddexp.html

Parameters

NameType
otherTensor

Returns

Tensor


logaddexp2

logaddexp2(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.logaddexp2.html

Parameters

NameType
otherTensor

Returns

Tensor


logdet

logdet(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.logdet.html

Returns

Tensor


logicalAnd

logicalAnd(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.logical_and.html

Parameters

NameType
otherTensor

Returns

Tensor


logicalNot

logicalNot(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.logical_not.html

Returns

Tensor


logicalOr

logicalOr(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.logical_or.html

Parameters

NameType
otherTensor

Returns

Tensor


logicalXor

logicalXor(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.logical_xor.html

Parameters

NameType
otherTensor

Returns

Tensor


lt

lt(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.lt.html

Parameters

NameType
othernumber

Returns

Tensor

lt(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


luSolve

luSolve(LUData, LUPivots): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.lu_solve.html

Parameters

NameType
LUDataTensor
LUPivotsTensor

Returns

Tensor


mH

mH(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.mH.html

Returns

Tensor


mT

mT(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.mT.html

Returns

Tensor


maskedFill

maskedFill(mask, value): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.masked_fill.html

Parameters

NameType
maskTensor
valuenumber

Returns

Tensor

maskedFill(mask, value): Tensor

Parameters

NameType
maskTensor
valueTensor

Returns

Tensor


maskedScatter

maskedScatter(mask, source): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.masked_scatter.html

Parameters

NameType
maskTensor
sourceTensor

Returns

Tensor


maskedSelect

maskedSelect(mask): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.masked_select.html

Parameters

NameType
maskTensor

Returns

Tensor


matmul

matmul(other): Tensor

Performs matrix multiplication with other tensor.

https://pytorch.org/docs/1.12/generated/torch.Tensor.matmul.html

Parameters

NameTypeDescription
otherTensortensor matrix multiplied this tensor.

Returns

Tensor


matrixExp

matrixExp(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.matrix_exp.html

Returns

Tensor


matrixH

matrixH(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.matrix_H.html

Returns

Tensor


matrixPower

matrixPower(n): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.matrix_power.html

Parameters

NameType
nnumber

Returns

Tensor


maximum

maximum(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.maximum.html

Parameters

NameType
otherTensor

Returns

Tensor


minimum

minimum(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.minimum.html

Parameters

NameType
otherTensor

Returns

Tensor


mm

mm(mat2): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.mm.html

Parameters

NameType
mat2Tensor

Returns

Tensor


moveaxis

moveaxis(source, destination): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.moveaxis.html

Parameters

NameType
sourcenumber[]
destinationnumber[]

Returns

Tensor

moveaxis(source, destination): Tensor

Parameters

NameType
sourcenumber
destinationnumber

Returns

Tensor


movedim

movedim(source, destination): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.movedim.html

Parameters

NameType
sourcenumber[]
destinationnumber[]

Returns

Tensor

movedim(source, destination): Tensor

Parameters

NameType
sourcenumber
destinationnumber

Returns

Tensor


msort

msort(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.msort.html

Returns

Tensor


mul

mul(other): Tensor

Multiplies input by other scalar or tensor.

https://pytorch.org/docs/1.12/generated/torch.Tensor.mul.html

Parameters

NameTypeDescription
othernumber | TensorScalar or tensor multiplied with each element in this tensor.

Returns

Tensor


multiply

multiply(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.multiply.html

Parameters

NameType
otherTensor

Returns

Tensor

multiply(other): Tensor

Parameters

NameType
othernumber

Returns

Tensor


mv

mv(vec): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.mv.html

Parameters

NameType
vecTensor

Returns

Tensor


mvlgamma

mvlgamma(p): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.mvlgamma.html

Parameters

NameType
pnumber

Returns

Tensor


narrow

narrow(dim, start, length): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.narrow.html

Parameters

NameType
dimnumber
startnumber
lengthnumber

Returns

Tensor

narrow(dim, start, length): Tensor

Parameters

NameType
dimnumber
startTensor
lengthnumber

Returns

Tensor


narrowCopy

narrowCopy(dim, start, length): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.narrow_copy.html

Parameters

NameType
dimnumber
startnumber
lengthnumber

Returns

Tensor


ne

ne(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.ne.html

Parameters

NameType
othernumber

Returns

Tensor

ne(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


neg

neg(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.neg.html

Returns

Tensor


negative

negative(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.negative.html

Returns

Tensor


nextafter

nextafter(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.nextafter.html

Parameters

NameType
otherTensor

Returns

Tensor


nonzero

nonzero(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.nonzero.html

Returns

Tensor


notEqual

notEqual(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.not_equal.html

Parameters

NameType
othernumber

Returns

Tensor

notEqual(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


numpyT

numpyT(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.numpy_T.html

Returns

Tensor


orgqr

orgqr(input2): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.orgqr.html

Parameters

NameType
input2Tensor

Returns

Tensor


ormqr

ormqr(input2, input3, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.ormqr.html

Parameters

NameType
input2Tensor
input3Tensor
options?Object
options.left?boolean
options.transpose?boolean

Returns

Tensor


outer

outer(vec2): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.outer.html

Parameters

NameType
vec2Tensor

Returns

Tensor


permute

permute(dims): Tensor

Returns a view of the original tensor input with its dimensions permuted.

https://pytorch.org/docs/1.12/generated/torch.Tensor.permute.html

Parameters

NameTypeDescription
dimsnumber[]The desired ordering of dimensions.

Returns

Tensor


positive

positive(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.positive.html

Returns

Tensor


pow

pow(exponent): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.pow.html

Parameters

NameType
exponentTensor

Returns

Tensor

pow(exponent): Tensor

Parameters

NameType
exponentnumber

Returns

Tensor


prelu

prelu(weight): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.prelu.html

Parameters

NameType
weightTensor

Returns

Tensor


put

put(index, source, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.put.html

Parameters

NameType
indexTensor
sourceTensor
options?Object
options.accumulate?boolean

Returns

Tensor


qPerChannelScales

qPerChannelScales(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.q_per_channel_scales.html

Returns

Tensor


qPerChannelZeroPoints

qPerChannelZeroPoints(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.q_per_channel_zero_points.html

Returns

Tensor


qr

qr(options?): [Tensor, Tensor]

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.qr.html

Parameters

NameType
options?Object
options.some?boolean

Returns

[Tensor, Tensor]


rad2deg

rad2deg(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.rad2deg.html

Returns

Tensor


ravel

ravel(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.ravel.html

Returns

Tensor


reciprocal

reciprocal(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.reciprocal.html

Returns

Tensor


relu

relu(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.relu.html

Returns

Tensor


remainder

remainder(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.remainder.html

Parameters

NameType
othernumber

Returns

Tensor

remainder(other): Tensor

Parameters

NameType
otherTensor

Returns

Tensor


renorm

renorm(p, dim, maxnorm): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.renorm.html

Parameters

NameType
pnumber
dimnumber
maxnormnumber

Returns

Tensor


repeat

repeat(repeats): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.repeat.html

Parameters

NameType
repeatsnumber[]

Returns

Tensor


repeatInterleave

repeatInterleave(repeats, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.repeat_interleave.html

Parameters

NameType
repeatsTensor
options?Object
options.dim?number
options.outputSize?number

Returns

Tensor

repeatInterleave(repeats, options?): Tensor

Parameters

NameType
repeatsnumber
options?Object
options.dim?number
options.outputSize?number

Returns

Tensor


reshape

reshape(shape): Tensor

Returns a tensor with the same data and number of elements as input, but with the specified shape.

https://pytorch.org/docs/1.12/generated/torch.Tensor.reshape.html

Parameters

NameTypeDescription
shapenumber[]The new shape.

Returns

Tensor


reshapeAs

reshapeAs(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.reshape_as.html

Parameters

NameType
otherTensor

Returns

Tensor


resolveConj

resolveConj(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.resolve_conj.html

Returns

Tensor


resolveNeg

resolveNeg(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.resolve_neg.html

Returns

Tensor


rowIndices

rowIndices(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.row_indices.html

Returns

Tensor


rsqrt

rsqrt(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.rsqrt.html

Returns

Tensor


selectScatter

selectScatter(src, dim, index): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.select_scatter.html

Parameters

NameType
srcTensor
dimnumber
indexnumber

Returns

Tensor


sgn

sgn(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.sgn.html

Returns

Tensor


sigmoid

sigmoid(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.sigmoid.html

Returns

Tensor


sign

sign(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.sign.html

Returns

Tensor


signbit

signbit(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.signbit.html

Returns

Tensor


sin

sin(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.sin.html

Returns

Tensor


sinc

sinc(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.sinc.html

Returns

Tensor


sinh

sinh(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.sinh.html

Returns

Tensor


size

size(): number[]

Returns the size of the tensor.

https://pytorch.org/docs/1.12/generated/torch.Tensor.size.html

Returns

number[]

size(): number[]

Returns the size of the tensor.

https://pytorch.org/docs/1.12/generated/torch.Tensor.size.html

Returns

number[]


slice

slice(options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.slice.html

Parameters

NameType
options?Object
options.dim?number
options.end?number
options.start?number
options.step?number

Returns

Tensor


sliceScatter

sliceScatter(src, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.slice_scatter.html

Parameters

NameType
srcTensor
options?Object
options.dim?number
options.end?number
options.start?number
options.step?number

Returns

Tensor


slogdet

slogdet(): [Tensor, Tensor]

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.slogdet.html

Returns

[Tensor, Tensor]


smm

smm(mat2): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.smm.html

Parameters

NameType
mat2Tensor

Returns

Tensor


softmax

softmax(dim): Tensor

Applies a softmax function. It is applied to all slices along dim, and will re-scale them so that the elements lie in the range [0, 1] and sum to 1.

https://pytorch.org/docs/1.12/generated/torch.nn.functional.softmax.html

Parameters

NameTypeDescription
dimnumberA dimension along which softmax will be computed.

Returns

Tensor


sparseMask

sparseMask(mask): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.sparse_mask.html

Parameters

NameType
maskTensor

Returns

Tensor


sqrt

sqrt(): Tensor

Computes the square-root value of each element in input.

https://pytorch.org/docs/1.12/generated/torch.Tensor.sqrt.html

Returns

Tensor


square

square(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.square.html

Returns

Tensor


squeeze

squeeze(dim?): Tensor

Returns a tensor with all the dimensions of input of size 1 removed.

https://pytorch.org/docs/1.12/generated/torch.Tensor.squeeze.html

Parameters

NameTypeDescription
dim?numberIf given, the input will be squeezed only in this dimension.

Returns

Tensor


sspaddmm

sspaddmm(mat1, mat2, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.sspaddmm.html

Parameters

NameType
mat1Tensor
mat2Tensor
options?Object
options.alpha?Number
options.beta?Number

Returns

Tensor


stride

stride(): number[]

Returns the stride of the tensor.

https://pytorch.org/docs/1.12/generated/torch.Tensor.stride.html

Returns

number[]

stride(dim): number

Returns the stride of the tensor.

https://pytorch.org/docs/1.12/generated/torch.Tensor.stride.html

Parameters

NameTypeDescription
dimnumberThe desired dimension in which stride is required.

Returns

number


sub

sub(other, options?): Tensor

Subtracts other from input.

https://pytorch.org/docs/1.12/generated/torch.Tensor.sub.html

Parameters

NameTypeDescription
othernumber | TensorThe scalar or tensor to subtract from input.
options?Object-
options.alpha?NumberThe multiplier for other. Default: 1.

Returns

Tensor


subtract

subtract(other, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.subtract.html

Parameters

NameType
otherTensor
options?Object
options.alpha?Number

Returns

Tensor

subtract(other, options?): Tensor

Parameters

NameType
othernumber
options?Object
options.alpha?Number

Returns

Tensor


sum

sum(): Tensor

Returns the sum of all elements in the input tensor.

https://pytorch.org/docs/1.12/generated/torch.Tensor.sum.html

Returns

Tensor

sum(dim, options?): Tensor

Returns the sum of each row of the input tensor in the given dimension dim. If dim is a list of dimensions, reduce over all of them.

https://pytorch.org/docs/1.12/generated/torch.Tensor.sum.html

Parameters

NameTypeDescription
dimnumber | number[]The dimension or dimensions to reduce.
options?Object-
options.keepdim?booleanWhether the output tensor has dim retained or not.

Returns

Tensor


sumToSize

sumToSize(size): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.sum_to_size.html

Parameters

NameType
sizenumber[]

Returns

Tensor


swapaxes

swapaxes(axis0, axis1): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.swapaxes.html

Parameters

NameType
axis0number
axis1number

Returns

Tensor


swapdims

swapdims(dim0, dim1): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.swapdims.html

Parameters

NameType
dim0number
dim1number

Returns

Tensor


symeig

symeig(options?): [Tensor, Tensor]

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.symeig.html

Parameters

NameType
options?Object
options.eigenvectors?boolean
options.upper?boolean

Returns

[Tensor, Tensor]


t

t(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.t.html

Returns

Tensor


take

take(index): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.take.html

Parameters

NameType
indexTensor

Returns

Tensor


takeAlongDim

takeAlongDim(indices, options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.take_along_dim.html

Parameters

NameType
indicesTensor
options?Object
options.dim?number

Returns

Tensor


tan

tan(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.tan.html

Returns

Tensor


tanh

tanh(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.tanh.html

Returns

Tensor


tile

tile(dims): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.tile.html

Parameters

NameType
dimsnumber[]

Returns

Tensor


to

to(options): Tensor

Performs Tensor conversion.

https://pytorch.org/docs/1.12/generated/torch.Tensor.to.html

Parameters

NameTypeDescription
optionsTensorOptionsTensor options.

Returns

Tensor


toSparse

toSparse(sparseDim): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.to_sparse.html

Parameters

NameType
sparseDimnumber

Returns

Tensor

toSparse(): Tensor

Returns

Tensor


toSparseBsc

toSparseBsc(blocksize): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.to_sparse_bsc.html

Parameters

NameType
blocksizenumber[]

Returns

Tensor


toSparseBsr

toSparseBsr(blocksize): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.to_sparse_bsr.html

Parameters

NameType
blocksizenumber[]

Returns

Tensor


toSparseCsc

toSparseCsc(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.to_sparse_csc.html

Returns

Tensor


toSparseCsr

toSparseCsr(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.to_sparse_csr.html

Returns

Tensor


topk

topk(k, options?): [Tensor, Tensor]

Returns a list of two Tensors where the first represents the k largest elements of the given input tensor, and the second represents the indices of the k largest elements.

https://pytorch.org/docs/1.12/generated/torch.Tensor.topk.html

Parameters

NameTypeDescription
knumberThe k in "top-k"
options?Objecttopk Options as keywords argument in pytorch
options.dim?numberThe dimension to sort along. If dim is not given, the last dimension of the input is chosen.
options.largest?booleanControls whether to return largest or smallest elements. It is set to True by default.
options.sorted?booleanControls whether to return the elements in sorted order. It is set to True by default.

Returns

[Tensor, Tensor]


trace

trace(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.trace.html

Returns

Tensor


triangularSolve

triangularSolve(A, options?): [Tensor, Tensor]

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.triangular_solve.html

Parameters

NameType
ATensor
options?Object
options.transpose?boolean
options.unitriangular?boolean
options.upper?boolean

Returns

[Tensor, Tensor]


tril

tril(options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.tril.html

Parameters

NameType
options?Object
options.diagonal?number

Returns

Tensor


triu

triu(options?): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.triu.html

Parameters

NameType
options?Object
options.diagonal?number

Returns

Tensor


trueDivide

trueDivide(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.true_divide.html

Parameters

NameType
otherTensor

Returns

Tensor

trueDivide(other): Tensor

Parameters

NameType
othernumber

Returns

Tensor


trunc

trunc(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.trunc.html

Returns

Tensor


typeAs

typeAs(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.type_as.html

Parameters

NameType
otherTensor

Returns

Tensor


unfold

unfold(dimension, size, step): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.unfold.html

Parameters

NameType
dimensionnumber
sizenumber
stepnumber

Returns

Tensor


unsqueeze

unsqueeze(dim): Tensor

Returns a new tensor with a dimension of size one inserted at the specified position.

https://pytorch.org/docs/1.12/generated/torch.Tensor.unsqueeze.html

Parameters

NameTypeDescription
dimnumberThe index at which to insert the singleton dimension.

Returns

Tensor


values

values(): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.values.html

Returns

Tensor


vdot

vdot(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.vdot.html

Parameters

NameType
otherTensor

Returns

Tensor


viewAs

viewAs(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.view_as.html

Parameters

NameType
otherTensor

Returns

Tensor


xlogy

xlogy(other): Tensor

experimental

https://pytorch.org/docs/1.12/generated/torch.Tensor.xlogy.html

Parameters

NameType
otherTensor

Returns

Tensor

xlogy(other): Tensor

Parameters

NameType
othernumber

Returns

Tensor