This commit is contained in:
Nicolas Patry
2023-07-10 15:13:52 +02:00
parent 49f4a77ffd
commit 2c8fbe8155

View File

@ -153,9 +153,6 @@ impl Tensor {
Self::ones_impl(shape, dtype, device, false) Self::ones_impl(shape, dtype, device, false)
} }
// 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<S: Into<Shape>>(shape: S, dtype: DType, device: &Device) -> Result<Self> { pub fn ones_var<S: Into<Shape>>(shape: S, dtype: DType, device: &Device) -> Result<Self> {
// Maybe we should allocate some actual storage for vars rather than just using a // Maybe we should allocate some actual storage for vars rather than just using a
// broadcasted scalar? // broadcasted scalar?