pub struct Tensor { /* private fields */ }Implementations§
Source§impl Tensor
impl Tensor
pub fn new(primal: DynTensor) -> Self
pub fn from_slice<T>(data: &[T], dims: &[usize]) -> Result<Self>where
T: DynTensorTyped + Copy,
pub fn scalar_type(&self) -> ScalarType
pub fn dims(&self) -> &[usize]
pub fn ndim(&self) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn axis_classes(&self) -> &[usize]
pub fn is_dense(&self) -> bool
pub fn is_diag(&self) -> bool
pub fn requires_grad(&self) -> bool
pub fn with_requires_grad(self, enabled: bool) -> Self
pub fn detach(&self) -> Self
pub fn to_dense(&self) -> Result<Self>
pub fn grad(&self) -> Result<Option<Self>>
pub fn zero_grad(&self) -> Result<()>
pub fn backward(&self) -> Result<()>
pub fn backward_with_seed(&self, seed: &Self) -> Result<()>
pub fn add(&self, rhs: &Self) -> Result<Self>
pub fn exp(&self) -> Result<Self>
pub fn sum(&self) -> Result<Self>
pub fn einsum(subscripts: &str, operands: &[&Self]) -> Result<Self>
pub fn solve(&self, rhs: &Self) -> Result<Self>
pub fn lstsq(&self, rhs: &Self) -> Result<LstsqResult>
pub fn solve_triangular(&self, rhs: &Self, upper: bool) -> Result<Self>
pub fn det(&self) -> Result<Self>
pub fn inv(&self) -> Result<Self>
pub fn slogdet(&self) -> Result<SlogdetResult>
pub fn cholesky(&self) -> Result<Self>
pub fn lu(&self, pivot: LuPivot) -> Result<LuResult>
pub fn norm(&self, kind: NormKind) -> Result<Self>
pub fn vector_norm( &self, ord: VectorNormOrd, dim: Option<&[isize]>, keepdim: bool, ) -> Result<Self>
pub fn matrix_norm( &self, ord: MatrixNormOrd, dim: Option<(isize, isize)>, keepdim: bool, ) -> Result<Self>
pub fn qr(&self) -> Result<QrResult>
pub fn svd(&self, options: Option<SvdOptions>) -> Result<SvdResult>
pub fn eig(&self) -> Result<EigResult>
pub fn eigh(&self) -> Result<EighResult>
pub fn pinv(&self, rcond: Option<f64>) -> Result<Self>
pub fn matrix_exp(&self) -> Result<Self>
pub fn try_to_vec<T>(&self) -> Result<Vec<T>>where
T: DynTensorTyped + Copy,
pub fn try_get<T>(&self, index: &[usize]) -> Result<T>where
T: DynTensorTyped + Copy,
Trait Implementations§
Source§impl<T> From<StructuredTensor<T>> for Tensorwhere
T: DynTensorTyped + Copy,
impl<T> From<StructuredTensor<T>> for Tensorwhere
T: DynTensorTyped + Copy,
Source§fn from(value: StructuredTensor<T>) -> Self
fn from(value: StructuredTensor<T>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for Tensor
impl !RefUnwindSafe for Tensor
impl Send for Tensor
impl Sync for Tensor
impl Unpin for Tensor
impl !UnwindSafe for Tensor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> Twhere
Self: Distribution<T>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more