pub unsafe fn from_raw<T: Datum>(shape: &[usize], content: &[u8]) -> TractResult<Tensor> {
        let data = align::realign_slice(content, size_of::<T>());
        Ok(Tensor {
            null: false,
            dt: T::datum_type(),
            shape: shape.into(),
            data,
            alignment: T::datum_type().alignment(),
        })
    }
/// Create an tensor from raw data.
///
/// It copies the data, aligning it to the size of T.
Create an tensor from raw data.
It copies the data, aligning it to the size of T.
Create an tensor from raw data . It copies the data aligning it to the size of T .
pub unsafe fn from_raw<T: Datum>(shape: &[usize], content: &[u8]) -> TractResult<Tensor> {
        let data = align::realign_slice(content, size_of::<T>());
        Ok(Tensor {
            null: false,
            dt: T::datum_type(),
            shape: shape.into(),
            data,
            alignment: T::datum_type().alignment(),
        })
    }
pub unsafe fn from_raw < T : Datum > ( shape : & [ usize ] , content : & [ u8 ] ) -> TractResult < Tensor > { let data = align :: realign_slice ( content , size_of :: < T > ( ) ) ; Ok ( Tensor { null : false , dt : T :: datum_type ( ) , shape : shape . into ( ) , data , alignment : T :: datum_type ( ) . alignment ( ) , } ) }
Create an tensor from raw data.
Create an tensor from raw data .
shape
&[usize]
content
&[u8]
shape
&[usize]
content
&[u8]