Type Alias TensorCell

Source
pub type TensorCell = AliasTrackingRefCell<Tensor>;

Aliased Type§

pub struct TensorCell { /* private fields */ }

Implementations§

Source§

impl TensorCell

Source

pub fn try_cpu(self) -> Result<TensorCell, BorrowError>

Return cell with the backing tensor on the CPU. If the backing tensor is on a GPU, it’ll create a new Tensor/TensorCell with a copy of the backing tensor. If the tensor is already on the CPU, it’ll just return a this cell.

Trait Implementations§

Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime RValue> for &'__deriveMoreLifetime TensorCell

Source§

type Error = TryIntoError<&'__deriveMoreLifetime RValue>

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'__deriveMoreLifetime RValue) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'__deriveMoreLifetime> TryFrom<&'__deriveMoreLifetime mut RValue> for &'__deriveMoreLifetime mut TensorCell

Source§

type Error = TryIntoError<&'__deriveMoreLifetime mut RValue>

The type returned in the event of a conversion error.
Source§

fn try_from( value: &'__deriveMoreLifetime mut RValue, ) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<RValue> for TensorCell

Source§

type Error = TryIntoError<RValue>

The type returned in the event of a conversion error.
Source§

fn try_from(value: RValue) -> Result<Self, Self::Error>

Performs the conversion.