Module creation

Module creation 

Source
Expand description

Creation methods for Tensor struct.

This module relates to the Python array API standard v2024.12.

Todo list:

Macros§

impl_from_nested_array 🔒
Implementation of this macro uses the same way of crate ndarray: https://docs.rs/ndarray/latest/ndarray/macro.array.html

Traits§

ArangeAPI
EmptyAPI
EmptyLikeAPI
EyeAPI
FromNestedArrayAPI
FullAPI
FullLikeAPI
LinspaceAPI
OnesAPI
OnesLikeAPI
TrilAPI
TriuAPI
UninitAPI
ZerosAPI
ZerosLikeAPI

Functions§

arange
Evenly spaced values within the half-open interval [start, stop) as one-dimensional array.
arange_f
assume_init
Converts a tensor with uninitialized values into a tensor with initialized values.
assume_init_f
Converts a tensor with uninitialized values into a tensor with initialized values.
empty
Uninitialized tensor having a specified shape.
empty_f
Safety
empty_like
Uninitialized tensor with the same shape as an input tensor.
empty_like_f
Safety
eye
Returns a two-dimensional array with ones on the kth diagonal and zeros elsewhere.
eye_f
full
New tensor having a specified shape and filled with given value.
full_f
full_like
New tensor filled with given value and having the same shape as an input tensor.
full_like_f
linspace
Evenly spaced numbers over a specified interval.
linspace_f
ones
New tensor filled with ones and having a specified shape.
ones_f
ones_like
New tensor filled with ones and having the same shape as an input tensor.
ones_like_f
tril
Returns the lower triangular part of a matrix (or a stack of matrices) x.
tril_f
triu
Returns the upper triangular part of a matrix (or a stack of matrices) x.
triu_f
uninit
New tensor filled with uninitialized values and having a specified shape.
uninit_f
zeros
New tensor filled with zeros and having a specified shape.
zeros_f
zeros_like
New tensor filled with zeros and having the same shape as an input tensor.
zeros_like_f