pub struct Linear { /* private fields */ }Expand description
Typed Cat-A builder for linear.
Implementations§
Source§impl Linear
impl Linear
Sourcepub fn new(x: TensorRef, w: TensorRef, b: TensorRef, out: TensorRef) -> Self
pub fn new(x: TensorRef, w: TensorRef, b: TensorRef, out: TensorRef) -> Self
Create a builder for out[i] = sum_k x[k] * w[k, i] + b[i].
Sourcepub fn build(self) -> Result<Program, TensorRefError>
pub fn build(self) -> Result<Program, TensorRefError>
Validate tensor metadata and materialize the linear Program.
§Errors
Returns TensorRefError when dtypes, names, shapes, or dimensions
violate the linear-layer contract.
Source§impl Linear
impl Linear
Sourcepub fn with_workgroup_size(self, size: [u32; 3]) -> Self
pub fn with_workgroup_size(self, size: [u32; 3]) -> Self
Override the generated Program workgroup size.
Sourcepub fn with_region_generator(self, name: &'static str) -> Self
pub fn with_region_generator(self, name: &'static str) -> Self
Override the Region generator id.
Sourcepub fn with_tenant_id(self, tenant_id: u32) -> Self
pub fn with_tenant_id(self, tenant_id: u32) -> Self
Stamp the Region metadata with a tenant id.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Linear
impl RefUnwindSafe for Linear
impl Send for Linear
impl Sync for Linear
impl Unpin for Linear
impl UnsafeUnpin for Linear
impl UnwindSafe for Linear
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> 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>
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