Struct caffe2_queue::RebatchingQueue
source · pub struct RebatchingQueue { /* private fields */ }
Expand description
| TODO: This is a very naive implementation with | a single mutex. We can do the atomic index | + circular queue optimizations or pull | something more heavy-weight later
Implementations§
source§impl RebatchingQueue
impl RebatchingQueue
pub fn new(capacity: usize, num_blobs: usize) -> Self
pub fn can_read(&self) -> bool
pub fn dequeue( &mut self, context: &mut CPUContext, num_elements: usize, outputs: &Vec<*mut TensorCPU> ) -> bool
pub fn can_write(&self) -> bool
pub fn enqueue_one( &mut self, context: &mut CPUContext, inputs: &Vec<*const TensorCPU> ) -> bool
pub fn enqueue_many( &mut self, context: &mut CPUContext, inputs: &Vec<*const TensorCPU> ) -> bool
pub fn enqueue(&mut self, splitted_inputs: Vec<Vec<TensorCPU>>) -> bool
pub fn capacity(&self) -> usize
pub fn num_blobs(&self) -> usize
pub fn is_closed(&self) -> bool
pub fn close(&mut self)
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RebatchingQueue
impl !Send for RebatchingQueue
impl !Sync for RebatchingQueue
impl Unpin for RebatchingQueue
impl !UnwindSafe for RebatchingQueue
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.