TensorView

Type Alias TensorView 

Source
pub type TensorView<'a> = TensorBase<&'a Storage>;
Expand description

Type alias for tensor views that borrow from existing storage.

TensorView provides a lightweight way to create tensor slices and views without copying data, using borrowed storage.

Aliased Type§

pub struct TensorView<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> TensorView<'a>

Implementation for TensorView - reuse Tensor logic

Source

pub fn slice<S: IntoSliceElem + Copy>(&self, specs: S) -> TensorView<'a>

Creates a slice view of this tensor view.

This method provides zero-copy slicing capabilities for tensor views.

§Parameters
  • specs - The slice specification (indices, ranges, tuples, etc.)
§Returns

A new TensorView representing the sliced portion.

§Examples
use slsl::{s, Tensor};

let tensor = Tensor::zeros::<f32>([4, 6])?;
let view = tensor.view();

// Single index
let row = view.slice(1);
assert_eq!(row.shape().as_slice(), &[6]);

// Range slice using s! macro
let rows = view.slice(s![1..3]);
assert_eq!(rows.shape().as_slice(), &[2, 6]);

Trait Implementations§

Source§

impl Add<f32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: f32) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<f32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: f32) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<f64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: f64) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<f64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: f64) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<i16> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: i16) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<i16> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: i16) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<i32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: i32) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<i32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: i32) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<i64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: i64) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<i64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: i64) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<i8> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: i8) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<i8> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: i8) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<u16> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: u16) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<u16> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: u16) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<u32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: u32) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<u32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: u32) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<u64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: u64) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<u64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: u64) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<u8> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: u8) -> Self::Output

Performs the + operation. Read more
Source§

impl Add<u8> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the + operator.
Source§

fn add(self, other: u8) -> Self::Output

Performs the + operation. Read more
Source§

impl Debug for TensorView<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Div<bf16> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: bf16) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<bf16> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: bf16) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f16> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: f16) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f16> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: f16) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: f32) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: f32) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<f64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i16> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: i16) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i16> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: i16) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: i32) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: i32) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: i64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: i64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i8> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: i8) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<i8> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: i8) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u16> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: u16) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u16> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: u16) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: u32) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: u32) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: u64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: u64) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u8> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: u8) -> Self::Output

Performs the / operation. Read more
Source§

impl Div<u8> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the / operator.
Source§

fn div(self, other: u8) -> Self::Output

Performs the / operation. Read more
Source§

impl Mul<f32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<f64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: f64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i16> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: i16) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i16> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: i16) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: i32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: i32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: i64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: i64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i8> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: i8) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<i8> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: i8) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u16> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: u16) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u16> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: u16) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: u32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: u32) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: u64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: u64) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u8> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: u8) -> Self::Output

Performs the * operation. Read more
Source§

impl Mul<u8> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the * operator.
Source§

fn mul(self, other: u8) -> Self::Output

Performs the * operation. Read more
Source§

impl Sub<f32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: f32) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<f32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: f32) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<f64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: f64) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<f64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: f64) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<i16> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: i16) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<i16> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: i16) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<i32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: i32) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<i32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: i32) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<i64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: i64) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<i64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: i64) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<i8> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: i8) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<i8> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: i8) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<u16> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: u16) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<u16> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: u16) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<u32> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: u32) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<u32> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: u32) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<u64> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: u64) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<u64> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: u64) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<u8> for &TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: u8) -> Self::Output

Performs the - operation. Read more
Source§

impl Sub<u8> for TensorView<'_>

Source§

type Output = TensorBase<Storage>

The resulting type after applying the - operator.
Source§

fn sub(self, other: u8) -> Self::Output

Performs the - operation. Read more