use crate::error::Error;
use crate::neural_network::layers::activation::p_relu::PReLU;
use crate::neural_network::traits::ApplyWeights;
use ndarray::ArrayD;
use serde::{Deserialize, Serialize};
use std::borrow::Cow;
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PReLULayerWeight<'a> {
pub alpha: Cow<'a, ArrayD<f32>>,
}
impl ApplyWeights<PReLU> for PReLULayerWeight<'_> {
fn apply_to_layer(&self, layer: &mut PReLU) -> Result<(), Error> {
layer.set_weights((*self.alpha).clone())?;
Ok(())
}
}