juice icon indicating copy to clipboard operation
juice copied to clipboard

In new arch, make Layer operations return Result instead of panicking internally

Open hweom opened this issue 2 years ago • 0 comments

Instead of

pub trait Layer<B: IBackend>: Debug {
    fn compute_output(&self, backend: &B, context: &mut Context);
    fn compute_gradients(&self, backend: &B, context: &mut Context);
}

we would have

pub trait Layer<B: IBackend>: Debug {
    fn compute_output(&self, backend: &B, context: &mut Context) -> Result<(), LayerError>;
    fn compute_gradients(&self, backend: &B, context: &mut Context) -> Result<(), LayerError>;
}

hweom avatar Jan 08 '23 22:01 hweom