Skip to main content

is_dense

Function is_dense 

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

Check if the current tensor fills its buffer without gaps.

Unlike is_contiguous, this holds for any ordering of the dimensions: a permuted tensor is dense, a tensor whose rows were padded by a pitched allocator is not. Dimensions of size one carry no information about the layout and are ignored.