pub struct Tensor {
pub name: String,
pub role: TensorRole,
pub logical: Option<TensorType>,
pub encoding: TensorEncoding,
}Expand description
A logical tensor and the physical storage used to represent its values.
Fields§
§name: StringOriginal or adapter-assigned display name.
role: TensorRoleSemantic role assigned by an architecture adapter.
logical: Option<TensorType>Logical dimensions, absent when an unknown encoding hides them.
encoding: TensorEncodingPhysical representation and references to its stored bytes.
Implementations§
Source§impl Tensor
impl Tensor
Sourcepub fn new(
name: String,
role: TensorRole,
shape: Option<Vec<u64>>,
encoding: TensorEncoding,
) -> Self
pub fn new( name: String, role: TensorRole, shape: Option<Vec<u64>>, encoding: TensorEncoding, ) -> Self
Build a descriptor, inferring a logical dtype only for dense storage.
Call Self::validate to check consistency with the physical encoding.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Tensor
impl<'de> Deserialize<'de> for Tensor
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
Auto Trait Implementations§
impl Freeze for Tensor
impl RefUnwindSafe for Tensor
impl Send for Tensor
impl Sync for Tensor
impl Unpin for Tensor
impl UnsafeUnpin for Tensor
impl UnwindSafe for Tensor
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