pub struct TorchScriptExporter { /* private fields */ }Expand description
TorchScript exporter
Implementations§
Source§impl TorchScriptExporter
impl TorchScriptExporter
pub fn new() -> Self
pub fn with_parameters(self, export_parameters: bool) -> Self
pub fn with_optimization_level(self, level: OptimizationLevel) -> Self
Sourcepub fn export_model(
&self,
graph: &FxGraph,
model_name: &str,
) -> Result<TorchScriptModel>
pub fn export_model( &self, graph: &FxGraph, model_name: &str, ) -> Result<TorchScriptModel>
Export an FX graph to TorchScript model
Sourcepub fn export_graph(&self, fx_graph: &FxGraph) -> Result<TorchScriptGraph>
pub fn export_graph(&self, fx_graph: &FxGraph) -> Result<TorchScriptGraph>
Export an FX graph to TorchScript graph
Sourcepub fn add_operator_mapping(&mut self, fx_op: String, torchscript_op: String)
pub fn add_operator_mapping(&mut self, fx_op: String, torchscript_op: String)
Add custom operator mapping
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TorchScriptExporter
impl RefUnwindSafe for TorchScriptExporter
impl Send for TorchScriptExporter
impl Sync for TorchScriptExporter
impl Unpin for TorchScriptExporter
impl UnsafeUnpin for TorchScriptExporter
impl UnwindSafe for TorchScriptExporter
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more