pub struct GpuNeuralBuffer {
pub batch_size: usize,
pub input_dim: usize,
pub output_dim: usize,
pub data: Vec<f64>,
}Expand description
A mock GPU buffer for batched neural network inference.
In a real GPU backend this would be a device-side buffer; here we store a flat f64 array in host memory.
Fields§
§batch_size: usizeBatch size (number of samples).
input_dim: usizeDimensionality of each input sample.
output_dim: usizeDimensionality of each output sample.
data: Vec<f64>Flat data storage: batch_size * max(input_dim, output_dim) elements.
Implementations§
Source§impl GpuNeuralBuffer
impl GpuNeuralBuffer
Sourcepub fn pack_positions(positions: &[[f64; 3]]) -> Self
pub fn pack_positions(positions: &[[f64; 3]]) -> Self
Pack a slice of 3-D positions into a buffer suitable for network input.
Each position [x, y, z] becomes three consecutive f64 values.
Sourcepub fn unpack_forces(&self) -> Vec<[f64; 3]>
pub fn unpack_forces(&self) -> Vec<[f64; 3]>
Unpack the buffer contents as a list of 3-D force vectors.
Assumes data has been filled with batch_size * 3 values by
a prior inference step.
Trait Implementations§
Source§impl Clone for GpuNeuralBuffer
impl Clone for GpuNeuralBuffer
Source§fn clone(&self) -> GpuNeuralBuffer
fn clone(&self) -> GpuNeuralBuffer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GpuNeuralBuffer
impl RefUnwindSafe for GpuNeuralBuffer
impl Send for GpuNeuralBuffer
impl Sync for GpuNeuralBuffer
impl Unpin for GpuNeuralBuffer
impl UnsafeUnpin for GpuNeuralBuffer
impl UnwindSafe for GpuNeuralBuffer
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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