pub struct GpuWeightSlots { /* private fields */ }Expand description
Device-resident mapping from neural output slots to CNF variable ids.
Slots are grouped (one group per neural predicate instance). Each slot is a CNF var id (DIMACS, 1-based) whose log-weights should be updated from the group’s probability vector.
Implementations§
Source§impl GpuWeightSlots
impl GpuWeightSlots
Sourcepub fn upload(
provider: &CudaKernelProvider,
groups: &[Vec<u32>],
) -> Result<Self>
pub fn upload( provider: &CudaKernelProvider, groups: &[Vec<u32>], ) -> Result<Self>
Upload a slot mapping from host vectors.
groups[g][i] is the CNF variable id corresponding to label/slot i of group g.
pub fn num_groups(&self) -> u32
pub fn num_groups_usize(&self) -> usize
pub fn total_slots(&self) -> u32
pub fn group_offsets(&self) -> &TrackedCudaSlice<u32>
pub fn slot_cnf_var(&self) -> &TrackedCudaSlice<u32>
Sourcepub fn group_slot_cnf_var(&self, group_idx: usize) -> Result<CudaView<'_, u32>>
pub fn group_slot_cnf_var(&self, group_idx: usize) -> Result<CudaView<'_, u32>>
Device view over slot_cnf_var for a single group.
Auto Trait Implementations§
impl Freeze for GpuWeightSlots
impl RefUnwindSafe for GpuWeightSlots
impl Send for GpuWeightSlots
impl Sync for GpuWeightSlots
impl Unpin for GpuWeightSlots
impl UnsafeUnpin for GpuWeightSlots
impl UnwindSafe for GpuWeightSlots
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