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
Name | Type |
---|---|
other | number |
Returns
▸ And(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
_Lshift_
▸ Lshift(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.lshift.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ Lshift(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
_Or_
▸ Or(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.or.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ Or(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
_Rshift_
▸ Rshift(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.rshift.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ Rshift(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
_Xor_
▸ Xor(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.xor.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ Xor(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
_addmmActivation
▸ _addmmActivation(mat1
, mat2
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor._addmm_activation.html
Parameters
Name | Type |
---|---|
mat1 | Tensor |
mat2 | Tensor |
options? | Object |
options.alpha? | Number |
options.beta? | Number |
options.useGelu? | boolean |
Returns
_conj
▸ _conj(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor._conj.html
Returns
_conjPhysical
▸ _conjPhysical(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor._conj_physical.html
Returns
_fwPrimal
▸ _fwPrimal(level
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor._fw_primal.html
Parameters
Name | Type |
---|---|
level | number |
Returns
_indices
▸ _indices(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor._indices.html
Returns
_negView
▸ _negView(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor._neg_view.html
Returns
_nestedTensorSize
▸ _nestedTensorSize(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor._nested_tensor_size.html
Returns
_nestedTensorStrides
▸ _nestedTensorStrides(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor._nested_tensor_strides.html
Returns
_reshapeAlias
▸ _reshapeAlias(size
, stride
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor._reshape_alias.html
Parameters
Name | Type |
---|---|
size | number [] |
stride | number [] |
Returns
_values
▸ _values(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor._values.html
Returns
abs
▸ abs(): Tensor
Computes the absolute value of each element in input.
https://pytorch.org/docs/1.12/generated/torch.Tensor.abs.html
Returns
absolute
▸ absolute(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.absolute.html
Returns
acos
▸ acos(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.acos.html
Returns
acosh
▸ acosh(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.acosh.html
Returns
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
Name | Type | Description |
---|---|---|
other | number | Tensor | Scalar or tensor to be added to each element in this tensor. |
options? | Object | - |
options.alpha? | Number | The multiplier for other . Default: 1 . |
Returns
addbmm
▸ addbmm(batch1
, batch2
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.addbmm.html
Parameters
Name | Type |
---|---|
batch1 | Tensor |
batch2 | Tensor |
options? | Object |
options.alpha? | Number |
options.beta? | Number |
Returns
addcdiv
▸ addcdiv(tensor1
, tensor2
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.addcdiv.html
Parameters
Name | Type |
---|---|
tensor1 | Tensor |
tensor2 | Tensor |
options? | Object |
options.value? | Number |
Returns
addcmul
▸ addcmul(tensor1
, tensor2
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.addcmul.html
Parameters
Name | Type |
---|---|
tensor1 | Tensor |
tensor2 | Tensor |
options? | Object |
options.value? | Number |
Returns
addmm
▸ addmm(mat1
, mat2
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.addmm.html
Parameters
Name | Type |
---|---|
mat1 | Tensor |
mat2 | Tensor |
options? | Object |
options.alpha? | Number |
options.beta? | Number |
Returns
addmv
▸ addmv(mat
, vec
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.addmv.html
Parameters
Name | Type |
---|---|
mat | Tensor |
vec | Tensor |
options? | Object |
options.alpha? | Number |
options.beta? | Number |
Returns
addr
▸ addr(vec1
, vec2
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.addr.html
Parameters
Name | Type |
---|---|
vec1 | Tensor |
vec2 | Tensor |
options? | Object |
options.alpha? | Number |
options.beta? | Number |
Returns
adjoint
▸ adjoint(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.adjoint.html
Returns
alias
▸ alias(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.alias.html
Returns
alignAs
▸ alignAs(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.align_as.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
aminmax
▸ aminmax(options?
): [Tensor, Tensor]
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.aminmax.html
Parameters
Name | Type |
---|---|
options? | Object |
options.dim? | number |
options.keepdim? | boolean |
Returns
angle
▸ angle(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.angle.html
Returns
arccos
▸ arccos(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.arccos.html
Returns
arccosh
▸ arccosh(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.arccosh.html
Returns
arcsin
▸ arcsin(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.arcsin.html
Returns
arcsinh
▸ arcsinh(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.arcsinh.html
Returns
arctan
▸ arctan(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.arctan.html
Returns
arctan2
▸ arctan2(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.arctan2.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
arctanh
▸ arctanh(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.arctanh.html
Returns
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
Name | Type | Description |
---|---|---|
options? | Object | argmax Options as keywords argument in pytorch |
options.dim? | number | The dimension to reduce. If undefined , the argmax of the flattened input is returned. |
options.keepdim? | boolean | Whether the output tensor has dim retained or not. Ignored if dim is undefined . |
Returns
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
Name | Type | Description |
---|---|---|
options? | Object | argmin Options as keywords argument in pytorch |
options.dim? | number | The dimension to reduce. If undefined , the argmin of the flattened input is returned. |
options.keepdim? | boolean | Whether the output tensor has dim retained or not. Ignored if dim is undefined . |
Returns
argwhere
▸ argwhere(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.argwhere.html
Returns
asStrided
▸ asStrided(size
, stride
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.as_strided.html
Parameters
Name | Type |
---|---|
size | number [] |
stride | number [] |
options? | Object |
options.storageOffset? | number |
Returns
asStridedScatter
▸ asStridedScatter(src
, size
, stride
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.as_strided_scatter.html
Parameters
Name | Type |
---|---|
src | Tensor |
size | number [] |
stride | number [] |
options? | Object |
options.storageOffset? | number |
Returns
asin
▸ asin(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.asin.html
Returns
asinh
▸ asinh(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.asinh.html
Returns
atan
▸ atan(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.atan.html
Returns
atan2
▸ atan2(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.atan2.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
atanh
▸ atanh(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.atanh.html
Returns
baddbmm
▸ baddbmm(batch1
, batch2
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.baddbmm.html
Parameters
Name | Type |
---|---|
batch1 | Tensor |
batch2 | Tensor |
options? | Object |
options.alpha? | Number |
options.beta? | Number |
Returns
bitwiseAnd
▸ bitwiseAnd(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_and.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ bitwiseAnd(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
bitwiseLeftShift
▸ bitwiseLeftShift(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_left_shift.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
▸ bitwiseLeftShift(other
): Tensor
Parameters
Name | Type |
---|---|
other | number |
Returns
bitwiseNot
▸ bitwiseNot(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_not.html
Returns
bitwiseOr
▸ bitwiseOr(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_or.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ bitwiseOr(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
bitwiseRightShift
▸ bitwiseRightShift(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_right_shift.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
▸ bitwiseRightShift(other
): Tensor
Parameters
Name | Type |
---|---|
other | number |
Returns
bitwiseXor
▸ bitwiseXor(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.bitwise_xor.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ bitwiseXor(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
bmm
▸ bmm(mat2
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.bmm.html
Parameters
Name | Type |
---|---|
mat2 | Tensor |
Returns
broadcastTo
▸ broadcastTo(size
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.broadcast_to.html
Parameters
Name | Type |
---|---|
size | number [] |
Returns
ccolIndices
▸ ccolIndices(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.ccol_indices.html
Returns
ceil
▸ ceil(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.ceil.html
Returns
cholesky
▸ cholesky(options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.cholesky.html
Parameters
Name | Type |
---|---|
options? | Object |
options.upper? | boolean |
Returns
choleskyInverse
▸ choleskyInverse(options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.cholesky_inverse.html
Parameters
Name | Type |
---|---|
options? | Object |
options.upper? | boolean |
Returns
choleskySolve
▸ choleskySolve(input2
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.cholesky_solve.html
Parameters
Name | Type |
---|---|
input2 | Tensor |
options? | Object |
options.upper? | boolean |
Returns
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
Name | Type | Description |
---|---|---|
min | number | Tensor | Lower-bound of the range to be clamped to |
max? | number | Tensor | Upper-bound of the range to be clamped to |
Returns
▸ 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
Name | Type | Description |
---|---|---|
options | Object | - |
options.max? | number | Tensor | Upper-bound of the range to be clamped to |
options.min? | number | Tensor | Lower-bound of the range to be clamped to |
Returns
clampMax
▸ clampMax(max
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.clamp_max.html
Parameters
Name | Type |
---|---|
max | number |
Returns
▸ clampMax(max
): Tensor
Parameters
Name | Type |
---|---|
max | Tensor |
Returns
clampMin
▸ clampMin(min
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.clamp_min.html
Parameters
Name | Type |
---|---|
min | number |
Returns
▸ clampMin(min
): Tensor
Parameters
Name | Type |
---|---|
min | Tensor |
Returns
coalesce
▸ coalesce(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.coalesce.html
Returns
colIndices
▸ colIndices(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.col_indices.html
Returns
conj
▸ conj(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.conj.html
Returns
conjPhysical
▸ conjPhysical(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.conj_physical.html
Returns
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
Name | Type | Description |
---|---|---|
options? | Object | - |
options.memoryFormat | MemoryFormat | The desired memory format of returned Tensor. Default: torch.contiguousFormat. https://pytorch.org/docs/1.12/generated/torch.Tensor.contiguous.html |
Returns
copysign
▸ copysign(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.copysign.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
▸ copysign(other
): Tensor
Parameters
Name | Type |
---|---|
other | number |
Returns
corrcoef
▸ corrcoef(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.corrcoef.html
Returns
cos
▸ cos(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.cos.html
Returns
cosh
▸ cosh(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.cosh.html
Returns
countNonzero
▸ countNonzero(dim
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.count_nonzero.html
Parameters
Name | Type |
---|---|
dim | number [] |
Returns
▸ countNonzero(options?
): Tensor
Parameters
Name | Type |
---|---|
options? | Object |
options.dim? | number |
Returns
cross
▸ cross(other
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.cross.html
Parameters
Name | Type |
---|---|
other | Tensor |
options? | Object |
options.dim? | number |
Returns
crowIndices
▸ crowIndices(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.crow_indices.html
Returns
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];
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
dequantize
▸ dequantize(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.dequantize.html
Returns
det
▸ det(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.det.html
Returns
detach
▸ detach(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.detach.html
Returns
diag
▸ diag(options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.diag.html
Parameters
Name | Type |
---|---|
options? | Object |
options.diagonal? | number |
Returns
diagEmbed
▸ diagEmbed(options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.diag_embed.html
Parameters
Name | Type |
---|---|
options? | Object |
options.dim1? | number |
options.dim2? | number |
options.offset? | number |
Returns
diagflat
▸ diagflat(options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.diagflat.html
Parameters
Name | Type |
---|---|
options? | Object |
options.offset? | number |
Returns
diagonalScatter
▸ diagonalScatter(src
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.diagonal_scatter.html
Parameters
Name | Type |
---|---|
src | Tensor |
options? | Object |
options.dim1? | number |
options.dim2? | number |
options.offset? | number |
Returns
digamma
▸ digamma(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.digamma.html
Returns
dist
▸ dist(other
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.dist.html
Parameters
Name | Type |
---|---|
other | Tensor |
options? | Object |
options.p? | Number |
Returns
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
Name | Type | Description |
---|---|---|
other | number | Tensor | Scalar or tensor that divides each element in this tensor. |
options? | Object | - |
options.roundingMode? | "trunc" | "floor" | Type of rounding applied to the result |
Returns
dot
▸ dot(tensor
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.dot.html
Parameters
Name | Type |
---|---|
tensor | Tensor |
Returns
eq
▸ eq(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.eq.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ eq(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
erf
▸ erf(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.erf.html
Returns
erfc
▸ erfc(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.erfc.html
Returns
erfinv
▸ erfinv(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.erfinv.html
Returns
exp
▸ exp(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.exp.html
Returns
exp2
▸ exp2(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.exp2.html
Returns
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
Name | Type | Description |
---|---|---|
sizes | number [] | The expanded size, eg: ([3, 4]). |
Returns
expandAs
▸ expandAs(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.expand_as.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
expm1
▸ expm1(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.expm1.html
Returns
fix
▸ fix(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.fix.html
Returns
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
Name | Type | Description |
---|---|---|
dims | number [] | Axis to flip on. |
Returns
fliplr
▸ fliplr(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.fliplr.html
Returns
flipud
▸ flipud(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.flipud.html
Returns
floatPower
▸ floatPower(exponent
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.float_power.html
Parameters
Name | Type |
---|---|
exponent | Tensor |
Returns
▸ floatPower(exponent
): Tensor
Parameters
Name | Type |
---|---|
exponent | number |
Returns
floor
▸ floor(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.floor.html
Returns
floorDivide
▸ floorDivide(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.floor_divide.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
▸ floorDivide(other
): Tensor
Parameters
Name | Type |
---|---|
other | number |
Returns
fmax
▸ fmax(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.fmax.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
fmin
▸ fmin(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.fmin.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
fmod
▸ fmod(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.fmod.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ fmod(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
frac
▸ frac(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.frac.html
Returns
frexp
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.frexp.html
Returns
gcd
▸ gcd(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.gcd.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
ge
▸ ge(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.ge.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ ge(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
geqrf
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.geqrf.html
Returns
ger
▸ ger(vec2
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.ger.html
Parameters
Name | Type |
---|---|
vec2 | Tensor |
Returns
greater
▸ greater(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.greater.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ greater(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
greaterEqual
▸ greaterEqual(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.greater_equal.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ greaterEqual(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
gt
▸ gt(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.gt.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ gt(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
hardshrink
▸ hardshrink(options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.hardshrink.html
Parameters
Name | Type |
---|---|
options? | Object |
options.lambd? | Number |
Returns
heaviside
▸ heaviside(values
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.heaviside.html
Parameters
Name | Type |
---|---|
values | Tensor |
Returns
histc
▸ histc(options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.histc.html
Parameters
Name | Type |
---|---|
options? | Object |
options.bins? | number |
options.max? | Number |
options.min? | Number |
Returns
hypot
▸ hypot(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.hypot.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
i0
▸ i0(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.i0.html
Returns
igamma
▸ igamma(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.igamma.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
igammac
▸ igammac(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.igammac.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
indices
▸ indices(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.indices.html
Returns
inner
▸ inner(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.inner.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
intRepr
▸ intRepr(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.int_repr.html
Returns
inverse
▸ inverse(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.inverse.html
Returns
isfinite
▸ isfinite(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.isfinite.html
Returns
isinf
▸ isinf(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.isinf.html
Returns
isnan
▸ isnan(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.isnan.html
Returns
isneginf
▸ isneginf(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.isneginf.html
Returns
isposinf
▸ isposinf(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.isposinf.html
Returns
isreal
▸ isreal(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.isreal.html
Returns
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
Name | Type |
---|---|
other | Tensor |
Returns
lcm
▸ lcm(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.lcm.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
ldexp
▸ ldexp(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.ldexp.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
le
▸ le(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.le.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ le(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
lerp
▸ lerp(end
, weight
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.lerp.html
Parameters
Name | Type |
---|---|
end | Tensor |
weight | number |
Returns
▸ lerp(end
, weight
): Tensor
Parameters
Name | Type |
---|---|
end | Tensor |
weight | Tensor |
Returns
less
▸ less(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.less.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ less(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
lessEqual
▸ lessEqual(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.less_equal.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ lessEqual(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
lgamma
▸ lgamma(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.lgamma.html
Returns
log
▸ log(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.log.html
Returns
log10
▸ log10(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.log10.html
Returns
log1p
▸ log1p(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.log1p.html
Returns
log2
▸ log2(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.log2.html
Returns
logaddexp
▸ logaddexp(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.logaddexp.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
logaddexp2
▸ logaddexp2(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.logaddexp2.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
logdet
▸ logdet(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.logdet.html
Returns
logicalAnd
▸ logicalAnd(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.logical_and.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
logicalNot
▸ logicalNot(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.logical_not.html
Returns
logicalOr
▸ logicalOr(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.logical_or.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
logicalXor
▸ logicalXor(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.logical_xor.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
lt
▸ lt(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.lt.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ lt(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
luSolve
▸ luSolve(LUData
, LUPivots
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.lu_solve.html
Parameters
Name | Type |
---|---|
LUData | Tensor |
LUPivots | Tensor |
Returns
mH
▸ mH(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.mH.html
Returns
mT
▸ mT(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.mT.html
Returns
maskedFill
▸ maskedFill(mask
, value
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.masked_fill.html
Parameters
Name | Type |
---|---|
mask | Tensor |
value | number |
Returns
▸ maskedFill(mask
, value
): Tensor
Parameters
Name | Type |
---|---|
mask | Tensor |
value | Tensor |
Returns
maskedScatter
▸ maskedScatter(mask
, source
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.masked_scatter.html
Parameters
Name | Type |
---|---|
mask | Tensor |
source | Tensor |
Returns
maskedSelect
▸ maskedSelect(mask
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.masked_select.html
Parameters
Name | Type |
---|---|
mask | Tensor |
Returns
matmul
▸ matmul(other
): Tensor
Performs matrix multiplication with other tensor.
https://pytorch.org/docs/1.12/generated/torch.Tensor.matmul.html
Parameters
Name | Type | Description |
---|---|---|
other | Tensor | tensor matrix multiplied this tensor. |
Returns
matrixExp
▸ matrixExp(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.matrix_exp.html
Returns
matrixH
▸ matrixH(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.matrix_H.html
Returns
matrixPower
▸ matrixPower(n
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.matrix_power.html
Parameters
Name | Type |
---|---|
n | number |
Returns
maximum
▸ maximum(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.maximum.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
minimum
▸ minimum(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.minimum.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
mm
▸ mm(mat2
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.mm.html
Parameters
Name | Type |
---|---|
mat2 | Tensor |
Returns
moveaxis
▸ moveaxis(source
, destination
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.moveaxis.html
Parameters
Name | Type |
---|---|
source | number [] |
destination | number [] |
Returns
▸ moveaxis(source
, destination
): Tensor
Parameters
Name | Type |
---|---|
source | number |
destination | number |
Returns
movedim
▸ movedim(source
, destination
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.movedim.html
Parameters
Name | Type |
---|---|
source | number [] |
destination | number [] |
Returns
▸ movedim(source
, destination
): Tensor
Parameters
Name | Type |
---|---|
source | number |
destination | number |
Returns
msort
▸ msort(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.msort.html
Returns
mul
▸ mul(other
): Tensor
Multiplies input by other scalar or tensor.
https://pytorch.org/docs/1.12/generated/torch.Tensor.mul.html
Parameters
Name | Type | Description |
---|---|---|
other | number | Tensor | Scalar or tensor multiplied with each element in this tensor. |
Returns
multiply
▸ multiply(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.multiply.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
▸ multiply(other
): Tensor
Parameters
Name | Type |
---|---|
other | number |
Returns
mv
▸ mv(vec
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.mv.html
Parameters
Name | Type |
---|---|
vec | Tensor |
Returns
mvlgamma
▸ mvlgamma(p
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.mvlgamma.html
Parameters
Name | Type |
---|---|
p | number |
Returns
narrow
▸ narrow(dim
, start
, length
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.narrow.html
Parameters
Name | Type |
---|---|
dim | number |
start | number |
length | number |
Returns
▸ narrow(dim
, start
, length
): Tensor
Parameters
Name | Type |
---|---|
dim | number |
start | Tensor |
length | number |
Returns
narrowCopy
▸ narrowCopy(dim
, start
, length
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.narrow_copy.html
Parameters
Name | Type |
---|---|
dim | number |
start | number |
length | number |
Returns
ne
▸ ne(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.ne.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ ne(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
neg
▸ neg(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.neg.html
Returns
negative
▸ negative(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.negative.html
Returns
nextafter
▸ nextafter(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.nextafter.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
nonzero
▸ nonzero(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.nonzero.html
Returns
notEqual
▸ notEqual(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.not_equal.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ notEqual(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
numpyT
▸ numpyT(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.numpy_T.html
Returns
orgqr
▸ orgqr(input2
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.orgqr.html
Parameters
Name | Type |
---|---|
input2 | Tensor |
Returns
ormqr
▸ ormqr(input2
, input3
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.ormqr.html
Parameters
Name | Type |
---|---|
input2 | Tensor |
input3 | Tensor |
options? | Object |
options.left? | boolean |
options.transpose? | boolean |
Returns
outer
▸ outer(vec2
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.outer.html
Parameters
Name | Type |
---|---|
vec2 | Tensor |
Returns
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
Name | Type | Description |
---|---|---|
dims | number [] | The desired ordering of dimensions. |
Returns
positive
▸ positive(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.positive.html
Returns
pow
▸ pow(exponent
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.pow.html
Parameters
Name | Type |
---|---|
exponent | Tensor |
Returns
▸ pow(exponent
): Tensor
Parameters
Name | Type |
---|---|
exponent | number |
Returns
prelu
▸ prelu(weight
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.prelu.html
Parameters
Name | Type |
---|---|
weight | Tensor |
Returns
put
▸ put(index
, source
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.put.html
Parameters
Name | Type |
---|---|
index | Tensor |
source | Tensor |
options? | Object |
options.accumulate? | boolean |
Returns
qPerChannelScales
▸ qPerChannelScales(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.q_per_channel_scales.html
Returns
qPerChannelZeroPoints
▸ qPerChannelZeroPoints(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.q_per_channel_zero_points.html
Returns
qr
▸ qr(options?
): [Tensor, Tensor]
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.qr.html
Parameters
Name | Type |
---|---|
options? | Object |
options.some? | boolean |
Returns
rad2deg
▸ rad2deg(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.rad2deg.html
Returns
ravel
▸ ravel(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.ravel.html
Returns
reciprocal
▸ reciprocal(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.reciprocal.html
Returns
relu
▸ relu(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.relu.html
Returns
remainder
▸ remainder(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.remainder.html
Parameters
Name | Type |
---|---|
other | number |
Returns
▸ remainder(other
): Tensor
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
renorm
▸ renorm(p
, dim
, maxnorm
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.renorm.html
Parameters
Name | Type |
---|---|
p | number |
dim | number |
maxnorm | number |
Returns
repeat
▸ repeat(repeats
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.repeat.html
Parameters
Name | Type |
---|---|
repeats | number [] |
Returns
repeatInterleave
▸ repeatInterleave(repeats
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.repeat_interleave.html
Parameters
Name | Type |
---|---|
repeats | Tensor |
options? | Object |
options.dim? | number |
options.outputSize? | number |
Returns
▸ repeatInterleave(repeats
, options?
): Tensor
Parameters
Name | Type |
---|---|
repeats | number |
options? | Object |
options.dim? | number |
options.outputSize? | number |
Returns
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
Name | Type | Description |
---|---|---|
shape | number [] | The new shape. |
Returns
reshapeAs
▸ reshapeAs(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.reshape_as.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
resolveConj
▸ resolveConj(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.resolve_conj.html
Returns
resolveNeg
▸ resolveNeg(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.resolve_neg.html
Returns
rowIndices
▸ rowIndices(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.row_indices.html
Returns
rsqrt
▸ rsqrt(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.rsqrt.html
Returns
selectScatter
▸ selectScatter(src
, dim
, index
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.select_scatter.html
Parameters
Name | Type |
---|---|
src | Tensor |
dim | number |
index | number |
Returns
sgn
▸ sgn(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.sgn.html
Returns
sigmoid
▸ sigmoid(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.sigmoid.html
Returns
sign
▸ sign(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.sign.html
Returns
signbit
▸ signbit(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.signbit.html
Returns
sin
▸ sin(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.sin.html
Returns
sinc
▸ sinc(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.sinc.html
Returns
sinh
▸ sinh(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.sinh.html
Returns
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
Name | Type |
---|---|
options? | Object |
options.dim? | number |
options.end? | number |
options.start? | number |
options.step? | number |
Returns
sliceScatter
▸ sliceScatter(src
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.slice_scatter.html
Parameters
Name | Type |
---|---|
src | Tensor |
options? | Object |
options.dim? | number |
options.end? | number |
options.start? | number |
options.step? | number |
Returns
slogdet
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.slogdet.html
Returns
smm
▸ smm(mat2
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.smm.html
Parameters
Name | Type |
---|---|
mat2 | Tensor |
Returns
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
Name | Type | Description |
---|---|---|
dim | number | A dimension along which softmax will be computed. |
Returns
sparseMask
▸ sparseMask(mask
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.sparse_mask.html
Parameters
Name | Type |
---|---|
mask | Tensor |
Returns
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
square
▸ square(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.square.html
Returns
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
Name | Type | Description |
---|---|---|
dim? | number | If given, the input will be squeezed only in this dimension. |
Returns
sspaddmm
▸ sspaddmm(mat1
, mat2
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.sspaddmm.html
Parameters
Name | Type |
---|---|
mat1 | Tensor |
mat2 | Tensor |
options? | Object |
options.alpha? | Number |
options.beta? | Number |
Returns
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
Name | Type | Description |
---|---|---|
dim | number | The 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
Name | Type | Description |
---|---|---|
other | number | Tensor | The scalar or tensor to subtract from input. |
options? | Object | - |
options.alpha? | Number | The multiplier for other . Default: 1 . |
Returns
subtract
▸ subtract(other
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.subtract.html
Parameters
Name | Type |
---|---|
other | Tensor |
options? | Object |
options.alpha? | Number |
Returns
▸ subtract(other
, options?
): Tensor
Parameters
Name | Type |
---|---|
other | number |
options? | Object |
options.alpha? | Number |
Returns
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
▸ 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
Name | Type | Description |
---|---|---|
dim | number | number [] | The dimension or dimensions to reduce. |
options? | Object | - |
options.keepdim? | boolean | Whether the output tensor has dim retained or not. |
Returns
sumToSize
▸ sumToSize(size
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.sum_to_size.html
Parameters
Name | Type |
---|---|
size | number [] |
Returns
swapaxes
▸ swapaxes(axis0
, axis1
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.swapaxes.html
Parameters
Name | Type |
---|---|
axis0 | number |
axis1 | number |
Returns
swapdims
▸ swapdims(dim0
, dim1
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.swapdims.html
Parameters
Name | Type |
---|---|
dim0 | number |
dim1 | number |
Returns
symeig
▸ symeig(options?
): [Tensor, Tensor]
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.symeig.html
Parameters
Name | Type |
---|---|
options? | Object |
options.eigenvectors? | boolean |
options.upper? | boolean |
Returns
t
▸ t(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.t.html
Returns
take
▸ take(index
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.take.html
Parameters
Name | Type |
---|---|
index | Tensor |
Returns
takeAlongDim
▸ takeAlongDim(indices
, options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.take_along_dim.html
Parameters
Name | Type |
---|---|
indices | Tensor |
options? | Object |
options.dim? | number |
Returns
tan
▸ tan(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.tan.html
Returns
tanh
▸ tanh(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.tanh.html
Returns
tile
▸ tile(dims
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.tile.html
Parameters
Name | Type |
---|---|
dims | number [] |
Returns
to
▸ to(options
): Tensor
Performs Tensor conversion.
https://pytorch.org/docs/1.12/generated/torch.Tensor.to.html
Parameters
Name | Type | Description |
---|---|---|
options | TensorOptions | Tensor options. |
Returns
toSparse
▸ toSparse(sparseDim
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.to_sparse.html
Parameters
Name | Type |
---|---|
sparseDim | number |
Returns
▸ toSparse(): Tensor
Returns
toSparseBsc
▸ toSparseBsc(blocksize
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.to_sparse_bsc.html
Parameters
Name | Type |
---|---|
blocksize | number [] |
Returns
toSparseBsr
▸ toSparseBsr(blocksize
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.to_sparse_bsr.html
Parameters
Name | Type |
---|---|
blocksize | number [] |
Returns
toSparseCsc
▸ toSparseCsc(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.to_sparse_csc.html
Returns
toSparseCsr
▸ toSparseCsr(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.to_sparse_csr.html
Returns
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
Name | Type | Description |
---|---|---|
k | number | The k in "top-k" |
options? | Object | topk Options as keywords argument in pytorch |
options.dim? | number | The dimension to sort along. If dim is not given, the last dimension of the input is chosen. |
options.largest? | boolean | Controls whether to return largest or smallest elements. It is set to True by default. |
options.sorted? | boolean | Controls whether to return the elements in sorted order. It is set to True by default. |
Returns
trace
▸ trace(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.trace.html
Returns
triangularSolve
▸ triangularSolve(A
, options?
): [Tensor, Tensor]
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.triangular_solve.html
Parameters
Name | Type |
---|---|
A | Tensor |
options? | Object |
options.transpose? | boolean |
options.unitriangular? | boolean |
options.upper? | boolean |
Returns
tril
▸ tril(options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.tril.html
Parameters
Name | Type |
---|---|
options? | Object |
options.diagonal? | number |
Returns
triu
▸ triu(options?
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.triu.html
Parameters
Name | Type |
---|---|
options? | Object |
options.diagonal? | number |
Returns
trueDivide
▸ trueDivide(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.true_divide.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
▸ trueDivide(other
): Tensor
Parameters
Name | Type |
---|---|
other | number |
Returns
trunc
▸ trunc(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.trunc.html
Returns
typeAs
▸ typeAs(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.type_as.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
unfold
▸ unfold(dimension
, size
, step
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.unfold.html
Parameters
Name | Type |
---|---|
dimension | number |
size | number |
step | number |
Returns
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
Name | Type | Description |
---|---|---|
dim | number | The index at which to insert the singleton dimension. |
Returns
values
▸ values(): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.values.html
Returns
vdot
▸ vdot(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.vdot.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
viewAs
▸ viewAs(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.view_as.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
xlogy
▸ xlogy(other
): Tensor
experimental
https://pytorch.org/docs/1.12/generated/torch.Tensor.xlogy.html
Parameters
Name | Type |
---|---|
other | Tensor |
Returns
▸ xlogy(other
): Tensor
Parameters
Name | Type |
---|---|
other | number |