pub struct CustomBackwardOp {
pub handler: Arc<dyn CustomBackward>,
pub input_versions: Vec<VersionSnapshot>,
pub saved_storages: Vec<StorageHandle>,
pub saved_layouts: Vec<Layout>,
pub saved_shapes: Vec<Vec<usize>>,
}Expand description
Backward state for a custom op: the user’s handler + saved tensors.
Fields§
§handler: Arc<dyn CustomBackward>The user’s backward implementation.
input_versions: Vec<VersionSnapshot>Version snapshots for each input (for mutation checking).
saved_storages: Vec<StorageHandle>Tensors saved during forward for use in backward.
saved_layouts: Vec<Layout>§saved_shapes: Vec<Vec<usize>>Trait Implementations§
Auto Trait Implementations§
impl Freeze for CustomBackwardOp
impl !RefUnwindSafe for CustomBackwardOp
impl Send for CustomBackwardOp
impl Sync for CustomBackwardOp
impl Unpin for CustomBackwardOp
impl UnsafeUnpin for CustomBackwardOp
impl !UnwindSafe for CustomBackwardOp
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