pub struct Runner { /* private fields */ }Implementations§
Source§impl Runner
impl Runner
pub async fn new( runner_path: &Path, visible_device: Device, ) -> Result<Runner, String>
pub async fn load<T>(
&self,
fs: &Arc<T>,
runner_name: String,
required_framework_version: VersionReq,
runner_compat_version: u64,
runner_opts: Option<HashMap<String, RunnerOpt>>,
visible_device: Device,
carton_manifest_hash: Option<String>,
) -> Result<(), String>where
T: ReadableFileSystem + MaybeSend + MaybeSync + 'static,
T::FileType: ReadableFile + MaybeSend + MaybeSync + Unpin,
T::ReadDirPollerType: MaybeSend,
pub async fn infer_with_inputs( &self, tensors_orig: HashMap<String, Tensor>, ) -> Result<HashMap<String, Tensor>, String>
pub async fn streaming_infer_with_inputs( &self, tensors_orig: HashMap<String, Tensor>, ) -> impl Stream<Item = Result<HashMap<String, Tensor>, String>> + '_
pub async fn seal( &self, tensors_orig: HashMap<String, Tensor>, ) -> Result<u64, String>
pub async fn infer_with_handle( &self, handle: u64, ) -> Result<HashMap<String, Tensor>, String>
pub async fn streaming_infer_with_handle( &self, handle: u64, ) -> impl Stream<Item = Result<HashMap<String, Tensor>, String>> + '_
Sourcepub async fn pack<T>(
&self,
fs: &Arc<T>,
input_path: &Path,
temp_folder: &Path,
) -> Result<PathBuf, String>where
T: WritableFileSystem + MaybeSend + MaybeSync + 'static,
T::FileType: WritableFile + MaybeSend + MaybeSync + Unpin,
T::ReadDirPollerType: MaybeSend,
pub async fn pack<T>(
&self,
fs: &Arc<T>,
input_path: &Path,
temp_folder: &Path,
) -> Result<PathBuf, String>where
T: WritableFileSystem + MaybeSend + MaybeSync + 'static,
T::FileType: WritableFile + MaybeSend + MaybeSync + Unpin,
T::ReadDirPollerType: MaybeSend,
Pack a model and return a path to the output directory
pub async fn alloc_tensor<T: Clone + Default>( &self, shape: Vec<u64>, ) -> Result<Tensor, String>
Auto Trait Implementations§
impl !Freeze for Runner
impl !RefUnwindSafe for Runner
impl !UnwindSafe for Runner
impl Send for Runner
impl Sync for Runner
impl Unpin for Runner
impl UnsafeUnpin for Runner
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