pub struct FlexibleSession { /* private fields */ }Expand description
Compile-time settings without a fixed Device.
Pick the backend per graph via Self::compile_resolved or
Self::compile_on.
Implementations§
Source§impl FlexibleSession
impl FlexibleSession
pub fn new() -> Self
pub fn from_env() -> Self
pub fn with_device_policy(self, policy: DevicePolicy) -> Self
pub fn with_precision(self, precision: Precision) -> Self
pub fn with_op_policy(self, policy: PrecisionPolicy) -> Self
pub fn device_policy(&self) -> &DevicePolicy
pub fn precision(&self) -> Precision
pub fn compile_on( &self, graph: Graph, device: Device, ) -> Result<CompiledGraph, String>
pub fn compile_with_on( &self, graph: Graph, device: Device, options: &CompileOptions, ) -> Result<CompiledGraph, String>
pub fn compile_resolved( &self, graph: Graph, hint: Option<Device>, ) -> Result<CompiledGraph, String>
pub fn compile_resolved_with( &self, graph: Graph, hint: Option<Device>, options: &CompileOptions, ) -> Result<CompiledGraph, String>
Source§impl FlexibleSession
impl FlexibleSession
pub fn compile_hir_on( &self, hir: HirModule, device: Device, ) -> Result<CompiledGraph, LowerError>
pub fn compile_module_on( &self, module: GraphModule, device: Device, ) -> Result<CompiledGraph, LowerError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FlexibleSession
impl RefUnwindSafe for FlexibleSession
impl Send for FlexibleSession
impl Sync for FlexibleSession
impl Unpin for FlexibleSession
impl UnsafeUnpin for FlexibleSession
impl UnwindSafe for FlexibleSession
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