pub struct CaptureDevice { /* private fields */ }Expand description
Reusable logical device for isolated graph-capture scopes.
Device identifiers are deliberately monotonic and never recycled. This keeps stale tensor
handles from aliasing a newer capture device without requiring an identity registry. Since a
DeviceId has a u16 backend-local index, creating more than 65,536 capture devices in one
process will panic. A device can be reused for any number of sequential capture scopes.
Implementations§
Source§impl CaptureDevice
impl CaptureDevice
Sourcepub fn capture_scope(
&self,
capture: impl FnOnce(CaptureScope) -> CompletedCaptureScope,
) -> Result<CapturedGraph, CaptureError>
pub fn capture_scope( &self, capture: impl FnOnce(CaptureScope) -> CompletedCaptureScope, ) -> Result<CapturedGraph, CaptureError>
Capture one operation scope on this reusable device.
The closure receives a CaptureScope and must return the token produced by
CaptureScope::complete, declaring both the runtime input and requested output tensor
IDs. A fresh session is installed before the closure runs and is always unregistered
afterward, including while unwinding from a panic. Only one scope may be active on a capture
device at a time. Calling complete closes the session immediately, so the closure must not
perform more tensor operations before returning the completion token.
Trait Implementations§
Source§impl Clone for CaptureDevice
impl Clone for CaptureDevice
impl Copy for CaptureDevice
Source§impl Debug for CaptureDevice
impl Debug for CaptureDevice
Source§impl Default for CaptureDevice
impl Default for CaptureDevice
Source§impl Device for CaptureDevice
impl Device for CaptureDevice
Source§impl DeviceOps for CaptureDevice
impl DeviceOps for CaptureDevice
impl Eq for CaptureDevice
Source§impl PartialEq for CaptureDevice
impl PartialEq for CaptureDevice
impl StructuralPartialEq for CaptureDevice
Auto Trait Implementations§
impl Freeze for CaptureDevice
impl RefUnwindSafe for CaptureDevice
impl Send for CaptureDevice
impl Sync for CaptureDevice
impl Unpin for CaptureDevice
impl UnsafeUnpin for CaptureDevice
impl UnwindSafe for CaptureDevice
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.