From 49f4a77ffd715141b50e17abda56a14a1e501886 Mon Sep 17 00:00:00 2001 From: Nicolas Patry Date: Mon, 10 Jul 2023 15:11:48 +0200 Subject: [PATCH] Put them back. --- candle-core/src/tensor.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/candle-core/src/tensor.rs b/candle-core/src/tensor.rs index cf8d01e6..4a5d9d16 100644 --- a/candle-core/src/tensor.rs +++ b/candle-core/src/tensor.rs @@ -156,11 +156,11 @@ impl Tensor { // Hiding it from now, having this functions forces us to have *every* function that creates // a new tensor potentially `_var` Maybe having something more like `Tensor::ones(..).var()` // might be easier to check. - // pub fn ones_var>(shape: S, dtype: DType, device: &Device) -> Result { - // // Maybe we should allocate some actual storage for vars rather than just using a - // // broadcasted scalar? - // Self::ones_impl(shape, dtype, device, true) - // } + pub fn ones_var>(shape: S, dtype: DType, device: &Device) -> Result { + // Maybe we should allocate some actual storage for vars rather than just using a + // broadcasted scalar? + Self::ones_impl(shape, dtype, device, true) + } /// Create a new tensors filled with ones with same shape, dtype, and device /// as the other tensors @@ -208,9 +208,9 @@ impl Tensor { Self::zeros_impl(shape, dtype, device, false) } - // pub fn zeros_var>(shape: S, dtype: DType, device: &Device) -> Result { - // Self::zeros_impl(shape, dtype, device, true) - // } + pub fn zeros_var>(shape: S, dtype: DType, device: &Device) -> Result { + Self::zeros_impl(shape, dtype, device, true) + } /// Create a new tensors filled with ones with same shape, dtype, and device /// as the other tensors