pub struct PythonProcess { /* private fields */ }Expand description
A persistent Python child process that executes filter commands.
Implementations§
Source§impl PythonProcess
impl PythonProcess
Sourcepub fn spawn(
python_path: &str,
filters: &[(String, Vec<u8>, bool)],
) -> Result<Self>
pub fn spawn( python_path: &str, filters: &[(String, Vec<u8>, bool)], ) -> Result<Self>
Spawn a Python daemon and load filters into it.
pub fn fit( &mut self, node_id: &str, data: &Value, y: Option<&Value>, ) -> Result<Value>
pub fn forward( &mut self, node_id: &str, data: &Value, state: &Value, ) -> Result<Value>
pub fn composite_fit( &mut self, node_ids: &[String], data: &Value, y: Option<&Value>, ) -> Result<(Value, HashMap<String, Value>)>
pub fn composite_forward( &mut self, node_ids: &[String], data: &Value, ) -> Result<Value>
pub fn get_state(&mut self, node_id: &str) -> Result<Value>
pub fn set_state(&mut self, node_id: &str, state: &Value) -> Result<()>
pub fn get_gradients(&mut self, node_id: &str) -> Result<Value>
pub fn apply_gradients( &mut self, node_id: &str, gradients: &Value, ) -> Result<()>
pub fn shutdown(&mut self)
pub fn node_ids(&self) -> &[String]
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PythonProcess
impl RefUnwindSafe for PythonProcess
impl Send for PythonProcess
impl Sync for PythonProcess
impl Unpin for PythonProcess
impl UnsafeUnpin for PythonProcess
impl UnwindSafe for PythonProcess
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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