pub struct BinaryTensorPacket {
pub shape: Vec<i64>,
pub dtype: TensorDtype,
pub data: Vec<u8>,
}Fields§
§shape: Vec<i64>§dtype: TensorDtype§data: Vec<u8>Implementations§
Source§impl BinaryTensorPacket
impl BinaryTensorPacket
pub fn new( shape: Vec<i64>, dtype: TensorDtype, data: Vec<u8>, ) -> Result<Self, EngineError>
pub fn size_bytes(&self) -> usize
pub fn tensor_elements(&self) -> Result<usize, EngineError>
pub fn tensor_elements_cached( &self, cache: &mut Option<usize>, ) -> Result<usize, EngineError>
pub fn validate(&self) -> Result<(), EngineError>
pub fn view(&self) -> TensorView<'_>
pub fn as_borrowed(&self) -> BinaryTensorPacketRef<'_>
Trait Implementations§
Source§impl Clone for BinaryTensorPacket
impl Clone for BinaryTensorPacket
Source§fn clone(&self) -> BinaryTensorPacket
fn clone(&self) -> BinaryTensorPacket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BinaryTensorPacket
impl Debug for BinaryTensorPacket
Source§impl<'de> Deserialize<'de> for BinaryTensorPacket
impl<'de> Deserialize<'de> for BinaryTensorPacket
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> From<&'a BinaryTensorPacket> for BinaryTensorPacketRef<'a>
impl<'a> From<&'a BinaryTensorPacket> for BinaryTensorPacketRef<'a>
Source§fn from(packet: &'a BinaryTensorPacket) -> Self
fn from(packet: &'a BinaryTensorPacket) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for BinaryTensorPacket
impl RefUnwindSafe for BinaryTensorPacket
impl Send for BinaryTensorPacket
impl Sync for BinaryTensorPacket
impl Unpin for BinaryTensorPacket
impl UnsafeUnpin for BinaryTensorPacket
impl UnwindSafe for BinaryTensorPacket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more