pub struct NasGenome<B: Backend> { /* private fields */ }Expand description
One population’s worth of architecture-NAS genomes.
arch_ids[i] is the architecture index of individual i (in
0..num_variants); row i of weights holds that individual’s flat
weight vector, padded with trailing zeros out to max_param_count.
§Not Clone
NasGenome deliberately does not derive Clone: Burn tensors alias
their underlying storage, so a derived Clone would silently share buffers
rather than copy them. ArchNasStrategy::ask constructs a fresh
NasGenome with newly allocated tensors (built host-side via
Tensor::from_data) instead of cloning the struct — consistent with
WeightOnly and the phase-1 strategies.
Implementations§
Source§impl<B: Backend> NasGenome<B>
impl<B: Backend> NasGenome<B>
Sourcepub fn try_new(
arch_ids: Vec<usize>,
weights: Tensor<B, 2>,
) -> Result<Self, ConfigError>
pub fn try_new( arch_ids: Vec<usize>, weights: Tensor<B, 2>, ) -> Result<Self, ConfigError>
Assembles a population genome, checking one architecture id per row.
§Errors
Returns a ConfigError if weights has zero rows or if arch_ids
does not have exactly one entry per weight row (pop_size).
Trait Implementations§
Auto Trait Implementations§
impl<B> Freeze for NasGenome<B>where
<B as BackendTypes>::FloatTensorPrimitive: Freeze,
<B as BackendTypes>::QuantizedTensorPrimitive: Freeze,
impl<B> RefUnwindSafe for NasGenome<B>where
<B as BackendTypes>::FloatTensorPrimitive: RefUnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: RefUnwindSafe,
impl<B> Send for NasGenome<B>
impl<B> Sync for NasGenome<B>
impl<B> Unpin for NasGenome<B>where
<B as BackendTypes>::FloatTensorPrimitive: Unpin,
<B as BackendTypes>::QuantizedTensorPrimitive: Unpin,
impl<B> UnsafeUnpin for NasGenome<B>where
<B as BackendTypes>::FloatTensorPrimitive: UnsafeUnpin,
<B as BackendTypes>::QuantizedTensorPrimitive: UnsafeUnpin,
impl<B> UnwindSafe for NasGenome<B>where
<B as BackendTypes>::FloatTensorPrimitive: UnwindSafe,
<B as BackendTypes>::QuantizedTensorPrimitive: UnwindSafe,
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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