Tensor

Type alias exposing TorchSharp tensor under the shorter Toro name.

Instance members

NameDescription
this.Dimensions
this.ElementSize
this.H
this.Handle
this.IsInvalid
this.NumberOfElements
this.SparseIndices
this.SparseValues
this.T
this.TensorItems
this.TensorItems
this.TensorItems
this.TensorItems
this.TensorItems
this.TensorItems
this.TensorItems
this.TensorItems
this.TensorItems
this.bytes
this.device
this.device_index
this.device_type
this.dtype
this.grad
this.imag
this.is_cuda
this.is_leaf
this.is_meta
this.is_sparse
this.mH
this.mT
this.name
this.names
this.ndim
this.real
this.requires_grad
this.shape

Static members

NameDescription
Tensor.PeakCount
Tensor.TotalCount

TIdx

Index specifier for Tensor.at. I=single, S=slice, A=all, T=tensor, E=ellipsis, N=newaxis.

Union cases

NameDescription
A
E
I int
N
S(start, stop)
Sf start
St stop
T Tensor

Instance members

NameDescription
this.IsA
this.IsE
this.IsI
this.IsN
this.IsS
this.IsSf
this.IsSt
this.IsT

TensorOps

FunctionDescription
a .<. bElementwise a < b.
a .<=. bElementwise a≤ba \leq b.
a .<>. bElementwise a≠ba \neq b.
a .=. bElementwise a=ba = b.
a .>. bElementwise a > b.
a .>=. bElementwise a≥ba \geq b.
scalar vConvert a float to a TorchSharp Scalar for use with tensor operators.

(.<.)

a .<. b

Elementwise a &lt; b.

Parameters

  • a : Tensor
  • b : Tensor

Returns Tensor


(.<=.)

a .<=. b

Elementwise a≤ba \leq b.

Parameters

  • a : Tensor
  • b : Tensor

Returns Tensor


(.<>.)

a .<>. b

Elementwise a≠ba \neq b.

Parameters

  • a : Tensor
  • b : Tensor

Returns Tensor


(.=.)

a .=. b

Elementwise a=ba = b.

Parameters

  • a : Tensor
  • b : Tensor

Returns Tensor


(.>.)

a .>. b

Elementwise a &gt; b.

Parameters

  • a : Tensor
  • b : Tensor

Returns Tensor


(.>=.)

a .>=. b

Elementwise a≥ba \geq b.

Parameters

  • a : Tensor
  • b : Tensor

Returns Tensor


scalar

scalar v

Convert a float to a TorchSharp Scalar for use with tensor operators.

Parameters

  • v : float

Returns Scalar

TensorExtensions


Tensor module

FunctionDescription
keep tMove a tensor out of the current dispose scope so it
survives when that scope exits. Inside scoped { },
return values are auto-kept, so keep is only needed
for side-effect retention (e.g. caching a tensor in a mutable field).

keep

keep t

Move a tensor out of the current dispose scope so it survives when that scope exits. Inside scoped { }, return values are auto-kept, so keep is only needed for side-effect retention (e.g. caching a tensor in a mutable field).

Parameters

  • t : Tensor

Returns Tensor