pub struct TensorBinding {
pub name: String,
pub dtype: TensorType,
pub shape: Vec<u32>,
pub group: u32,
pub binding: u32,
pub read_only: bool,
}Expand description
A tensor binding for compute shader
Fields§
§name: StringBinding name
dtype: TensorTypeElement type
shape: Vec<u32>Shape dimensions
group: u32Binding group
binding: u32Binding index within group
read_only: boolRead-only flag
Implementations§
Source§impl TensorBinding
impl TensorBinding
Sourcepub fn new(name: impl Into<String>, dtype: TensorType, shape: &[u32]) -> Self
pub fn new(name: impl Into<String>, dtype: TensorType, shape: &[u32]) -> Self
Create a new tensor binding
Sourcepub fn element_count(&self) -> u32
pub fn element_count(&self) -> u32
Get total element count
Sourcepub fn to_wgsl_binding(&self) -> String
pub fn to_wgsl_binding(&self) -> String
Generate WGSL binding declaration
Trait Implementations§
Source§impl Clone for TensorBinding
impl Clone for TensorBinding
Source§fn clone(&self) -> TensorBinding
fn clone(&self) -> TensorBinding
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 moreAuto Trait Implementations§
impl Freeze for TensorBinding
impl RefUnwindSafe for TensorBinding
impl Send for TensorBinding
impl Sync for TensorBinding
impl Unpin for TensorBinding
impl UnsafeUnpin for TensorBinding
impl UnwindSafe for TensorBinding
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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