use std::ops::Deref;
use crate::inference::native_model::segmentation::PyanNetWeights;
use super::super::{CudaError, SafetensorsFile};
pub(super) use crate::inference::native_model::segmentation::LstmLayer;
#[cfg(feature = "_cuda-libraries")]
pub(super) const ONNX_GATE: [usize; 4] = [0, 2, 3, 1];
#[derive(Debug, Clone)]
pub(super) struct SegmentationWeights(PyanNetWeights);
impl SegmentationWeights {
pub(super) fn load(file: &SafetensorsFile) -> Result<Self, CudaError> {
PyanNetWeights::load(file.host())
.map(Self)
.map_err(Into::into)
}
}
impl Deref for SegmentationWeights {
type Target = PyanNetWeights;
fn deref(&self) -> &Self::Target {
&self.0
}
}