pub struct Var<T: FloatDType> { /* private fields */ }Implementations§
Source§impl<T: FloatDType> Var<T>
impl<T: FloatDType> Var<T>
pub fn new<A: ToTensor<T>>(array: A) -> Result<Tensor<T>>
pub fn empty<S: Into<Shape>>(shape: S) -> Result<Tensor<T>>
pub fn meta<S: Into<Shape>>(shape: S) -> Result<Tensor<T>>
pub fn full<S: Into<Shape>>(shape: S, value: T) -> Result<Tensor<T>>
pub fn zeros<S: Into<Shape>>(shape: S) -> Result<Tensor<T>>
pub fn ones<S: Into<Shape>>(shape: S) -> Result<Tensor<T>>
pub fn arange(start: T, end: T) -> Result<Tensor<T>>
pub fn from_vec<V: Into<Vec<T>>, S: Into<Shape>>( vec: V, shape: S, ) -> Result<Tensor<T>>
pub fn eye(size: usize) -> Result<Tensor<T>>
pub fn tril(size: usize, diagonal: bool) -> Result<Tensor<T>>
pub fn triu(size: usize, diagonal: bool) -> Result<Tensor<T>>
pub fn diag(diag: &[T]) -> Result<Tensor<T>>
pub fn linspace(start: T, stop: T, num: usize) -> Result<Tensor<T>>
pub fn randn<S: Into<Shape>>(mean: T, std: T, shape: S) -> Result<Tensor<T>>
pub fn rand<S: Into<Shape>>(min: T, max: T, shape: S) -> Result<Tensor<T>>
Auto Trait Implementations§
impl<T> Freeze for Var<T>
impl<T> RefUnwindSafe for Var<T>where
T: RefUnwindSafe,
impl<T> Send for Var<T>
impl<T> Sync for Var<T>
impl<T> Unpin for Var<T>where
T: Unpin,
impl<T> UnsafeUnpin for Var<T>
impl<T> UnwindSafe for Var<T>where
T: UnwindSafe,
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