Struct caffe2_export::C10OperatorWrapper
source · pub struct C10OperatorWrapper<Context> { /* private fields */ }
Expand description
| To make a c10 operator “C10Add” callable | from caffe2 as “C2MyAddOpName”, just | write | | To export the CPU kernel | | C10_EXPORT_C10_OP_TO_CAFFE2_CPU(C10Add, | C2MyAddOp) | | To export the CUDA kernel | | C10_EXPORT_C10_OP_TO_CAFFE2_CUDA(C10Add, | C2MyAddOp) |
Implementations§
source§impl<Context> C10OperatorWrapper<Context>
impl<Context> C10OperatorWrapper<Context>
pub fn new( op: &OperatorHandle, operator_def: &OperatorDef, ws: *mut Workspace ) -> Self
pub fn run_on_device(&mut self) -> bool
pub fn push_inputs(&mut self)
pub fn call_kernel(&mut self)
pub fn pop_outputs(&mut self)
pub fn array_inputs(&mut self) -> List<Tensor>
pub fn preallocated_outputs(&mut self) -> List<Tensor>
pub fn get_nontensor_argument(&mut self, argument: &Argument) -> IValue
pub fn get_nontensor_argument_with_name_and_default_value<T>( &mut self, name: &String, default_value: &Option<IValue> ) -> IValue
Auto Trait Implementations§
impl<Context> !RefUnwindSafe for C10OperatorWrapper<Context>
impl<Context> !Send for C10OperatorWrapper<Context>
impl<Context> !Sync for C10OperatorWrapper<Context>
impl<Context> Unpin for C10OperatorWrapper<Context>where Context: Unpin,
impl<Context> !UnwindSafe for C10OperatorWrapper<Context>
Blanket Implementations§
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.