juice
juice copied to clipboard
In new arch, make Layer operations return Result instead of panicking internally
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>;
}