mirror of
https://github.com/huggingface/candle.git
synced 2025-06-19 11:56:45 +00:00
Make some model cloneable. (#1125)
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
use candle::{Module, Result, Tensor};
|
||||
use candle_nn::VarBuilder;
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Embedding {
|
||||
inner: candle_nn::Embedding,
|
||||
span: tracing::Span,
|
||||
@ -26,7 +26,7 @@ impl Module for Embedding {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Linear {
|
||||
inner: candle_nn::Linear,
|
||||
span: tracing::Span,
|
||||
@ -52,7 +52,7 @@ impl Module for Linear {
|
||||
}
|
||||
|
||||
// Wrap the conv2d op to provide some tracing.
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct Conv2d {
|
||||
inner: candle_nn::Conv2d,
|
||||
span: tracing::Span,
|
||||
@ -78,6 +78,7 @@ pub fn conv2d(
|
||||
}
|
||||
|
||||
// QMatMul wrapper adding some tracing.
|
||||
#[derive(Clone)]
|
||||
pub struct QMatMul {
|
||||
inner: candle::quantized::QMatMul,
|
||||
span: tracing::Span,
|
||||
|
Reference in New Issue
Block a user