pub fn as_slice<D: Datum>(&self) -> TractResult<&[D]> {
        let datum_size = ::std::mem::size_of::<D>();
        unsafe {
            Ok(std::slice::from_raw_parts::<D>(
                self.as_ptr()?,
                self.data.len() / datum_size,
            ))
        }
    }
/// Access the data as a slice.
Access the data as a slice.
Access the data as a slice .
pub fn as_slice<D: Datum>(&self) -> TractResult<&[D]> {
        let datum_size = ::std::mem::size_of::<D>();
        unsafe {
            Ok(std::slice::from_raw_parts::<D>(
                self.as_ptr()?,
                self.data.len() / datum_size,
            ))
        }
    }
pub fn as_slice < D : Datum > ( & self ) -> TractResult < & [ D ] > { let datum_size = :: std :: mem :: size_of :: < D > ( ) ; unsafe { Ok ( std :: slice :: from_raw_parts :: < D > ( self . as_ptr ( ) ? , self . data . len ( ) / datum_size , ) ) } }
Access the data as a slice.
Access the data as a slice .
&self
&self