is_contiguous

Function is_contiguous 

Source
pub fn is_contiguous(shape: &[usize], strides: &[usize]) -> bool
Expand description

Check if the current tensor is contiguous.

A tensor is considered contiguous if its elements are stored in memory such that the stride at position k is equal to the product of the shapes of all dimensions greater than k.

This means that strides increase as you move from the rightmost to the leftmost dimension.