pub struct BatchCollector { /* private fields */ }Expand description
Collects neural predicate calls for batched evaluation.
During proof search, calls are accumulated. Before neural evaluation, they are grouped by network name for efficient batched forward passes.
Implementations§
Source§impl BatchCollector
impl BatchCollector
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a collector with pre-allocated capacity.
Sourcepub fn add(&mut self, call: NeuralCall)
pub fn add(&mut self, call: NeuralCall)
Add a neural call to the collector.
Sourcepub fn collect(&self) -> HashMap<String, Vec<&NeuralCall>>
pub fn collect(&self) -> HashMap<String, Vec<&NeuralCall>>
Group calls by network name for batched evaluation.
Returns a map from network name to list of calls for that network.
Sourcepub fn indices_for_network(&self, network: &str) -> Vec<usize>
pub fn indices_for_network(&self, network: &str) -> Vec<usize>
Get all input indices for a specific network.
These indices can be used to gather inputs from the tensor source into a batched tensor for the forward pass.
Sourcepub fn network_names(&self) -> Vec<String>
pub fn network_names(&self) -> Vec<String>
Get the names of all networks that have been called.
Sourcepub fn call_count_for_network(&self, network: &str) -> usize
pub fn call_count_for_network(&self, network: &str) -> usize
Get the number of calls for a specific network.
Sourcepub fn total_input_count(&self) -> usize
pub fn total_input_count(&self) -> usize
Get the total number of input indices across all calls.
Sourcepub fn iter(&self) -> impl Iterator<Item = &NeuralCall>
pub fn iter(&self) -> impl Iterator<Item = &NeuralCall>
Iterate over all calls.
Sourcepub fn take(&mut self) -> Vec<NeuralCall>
pub fn take(&mut self) -> Vec<NeuralCall>
Take ownership of all calls.