pub struct PythonIntegrationService { /* private fields */ }Expand description
Python integration service
Implementations§
Source§impl PythonIntegrationService
impl PythonIntegrationService
Sourcepub fn new(
config: PythonBindingConfig,
codegen_options: PythonCodeGenOptions,
) -> Self
pub fn new( config: PythonBindingConfig, codegen_options: PythonCodeGenOptions, ) -> Self
Create a new Python integration service
Sourcepub fn graph_to_pytorch(
&self,
graph: &FxGraph,
metadata: PyTorchModelMetadata,
) -> Result<GeneratedPythonCode>
pub fn graph_to_pytorch( &self, graph: &FxGraph, metadata: PyTorchModelMetadata, ) -> Result<GeneratedPythonCode>
Convert FxGraph to PyTorch model
Sourcepub fn pytorch_to_graph(
&mut self,
model_path: &Path,
metadata: PyTorchModelMetadata,
) -> Result<FxGraph>
pub fn pytorch_to_graph( &mut self, model_path: &Path, metadata: PyTorchModelMetadata, ) -> Result<FxGraph>
Import PyTorch model to FxGraph
Sourcepub fn generate_python_bindings(
&self,
graph: &FxGraph,
class_name: &str,
) -> Result<String>
pub fn generate_python_bindings( &self, graph: &FxGraph, class_name: &str, ) -> Result<String>
Generate Python bindings for FxGraph
Sourcepub fn export_for_deployment(
&self,
graph: &FxGraph,
target: PythonDeploymentTarget,
metadata: &PyTorchModelMetadata,
) -> Result<DeploymentPackage>
pub fn export_for_deployment( &self, graph: &FxGraph, target: PythonDeploymentTarget, metadata: &PyTorchModelMetadata, ) -> Result<DeploymentPackage>
Export graph for specific Python deployment target
Sourcepub fn graph_to_jax(
&self,
graph: &FxGraph,
metadata: &PyTorchModelMetadata,
) -> Result<String>
pub fn graph_to_jax( &self, graph: &FxGraph, metadata: &PyTorchModelMetadata, ) -> Result<String>
Generate JAX/Flax code from FxGraph
Sourcepub fn optimize_for_python_deployment(&self, graph: &mut FxGraph) -> Result<()>
pub fn optimize_for_python_deployment(&self, graph: &mut FxGraph) -> Result<()>
Optimize graph for Python deployment
Auto Trait Implementations§
impl Freeze for PythonIntegrationService
impl RefUnwindSafe for PythonIntegrationService
impl Send for PythonIntegrationService
impl Sync for PythonIntegrationService
impl Unpin for PythonIntegrationService
impl UnsafeUnpin for PythonIntegrationService
impl UnwindSafe for PythonIntegrationService
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