pub struct TensorDesc {
pub name: Option<String>,
pub optional: bool,
pub dtypes: Vec<String>,
pub dtype_class: Option<String>,
pub layout: Option<LayoutSpec>,
pub rank: Option<Value>,
pub shape_constraint: Option<String>,
pub fdx: Option<FdxSpec>,
pub device: Option<String>,
pub substrate: Option<String>,
}Expand description
A tensor descriptor (operand or, with return rules, an output; §3.2).
Fields§
§name: Option<String>Operand role name (diagnostic + maps to an FDX view name, §5.5).
optional: booltrue ⇒ this INPUT operand is OPTIONAL (§3.4 optional-operand support):
production registers the op BOTH with and without it (e.g. conv’s
bias). The importer’s key-builder fans each dtype variant into two
keys — one omitting this operand, one including it — when set. Only the
LAST input may be optional. Defaults to false (a required operand);
#[serde(default)] so every existing contract that omits the field
keeps building exactly one key per dtype variant (additive §11).
dtypes: Vec<String>Accepted DLPack dtype names (Fuel DType names; FDX §6.1). Strings;
the string → DType conversion is a lowering concern.
dtype_class: Option<String>Optional shorthand int|uint|float|any that expands at lower time (§3.4).
layout: Option<LayoutSpec>Layout capability flags (§4.1).
rank: Option<Value>Rank: exact int, "any", or a range "2..=4". Kept as a raw scalar so
2 and "any" both parse (the FKC parser interprets it later).
shape_constraint: Option<String>Free-predicate shape constraint (§3.5). Carried verbatim.
fdx: Option<FdxSpec>DLPack-extension (FDX) requirements (§3.2 fdx:).
device: Option<String>Placement device (inherited from front-matter unless overridden).
substrate: Option<String>FDX substrate class.
Trait Implementations§
Source§impl Clone for TensorDesc
impl Clone for TensorDesc
Source§impl Debug for TensorDesc
impl Debug for TensorDesc
Source§impl<'de> Deserialize<'de> for TensorDesc
impl<'de> Deserialize<'de> for TensorDesc
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>,
Auto Trait Implementations§
impl Freeze for TensorDesc
impl RefUnwindSafe for TensorDesc
impl Send for TensorDesc
impl Sync for TensorDesc
impl Unpin for TensorDesc
impl UnsafeUnpin for TensorDesc
impl UnwindSafe for TensorDesc
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more