pub struct MetadataBuilder { /* private fields */ }Expand description
Builder for a serialized metadata struct
Inputs/Outputs must be added in the same order they’re defined in the bind group
Implementations§
Source§impl MetadataBuilder
impl MetadataBuilder
Sourcepub fn register_buffer(&mut self, buffer_len: u64, address_type: AddressType)
pub fn register_buffer(&mut self, buffer_len: u64, address_type: AddressType)
Add an array to a builder
Sourcepub fn register_tensor(
&mut self,
buffer_len: u64,
shape: Shape,
strides: Strides,
address_type: AddressType,
)
pub fn register_tensor( &mut self, buffer_len: u64, shape: Shape, strides: Strides, address_type: AddressType, )
Add a tensor to a builder
pub fn static_len(&self, address_type: AddressType) -> usize
pub fn dynamic_len(&self, address_type: AddressType) -> usize
Sourcepub fn finish(
&mut self,
address_type: AddressType,
out: (&mut [u64], &mut [u64]),
)
pub fn finish( &mut self, address_type: AddressType, out: (&mut [u64], &mut [u64]), )
Build the final serialized metadata struct
Trait Implementations§
Source§impl Default for MetadataBuilder
impl Default for MetadataBuilder
Source§fn default() -> MetadataBuilder
fn default() -> MetadataBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MetadataBuilder
impl RefUnwindSafe for MetadataBuilder
impl Send for MetadataBuilder
impl Sync for MetadataBuilder
impl Unpin for MetadataBuilder
impl UnsafeUnpin for MetadataBuilder
impl UnwindSafe for MetadataBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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