summaryrefslogtreecommitdiff
path: root/candle-core/src/variable.rs
diff options
context:
space:
mode:
Diffstat (limited to 'candle-core/src/variable.rs')
-rw-r--r--candle-core/src/variable.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/candle-core/src/variable.rs b/candle-core/src/variable.rs
index 61800bf3..bdf8da4a 100644
--- a/candle-core/src/variable.rs
+++ b/candle-core/src/variable.rs
@@ -107,6 +107,10 @@ impl Var {
Ok(Self(inner))
}
+ pub fn as_detached_tensor(&self) -> Tensor {
+ self.0.detach()
+ }
+
pub fn as_tensor(&self) -> &Tensor {
&self.0
}