testing-tensor 0.1.1 → 0.1.2
raw patch · 3 files changed
+13/−2 lines, 3 files
Files
- CHANGELOG.md +4/−0
- src/Test/Tensor.hs +8/−1
- testing-tensor.cabal +1/−1
CHANGELOG.md view
@@ -1,5 +1,9 @@ # Revision history for tmp +## 0.1.2 -- 2025-08-27++* Add `subsWithStride`+ ## 0.1.1 -- 2025-08-27 * Add missing instances for `TestValue`
src/Test/Tensor.hs view
@@ -37,6 +37,7 @@ , foreachWith -- * Subtensors , subs+ , subsWithStride , convolve , convolveWithStride , padWith@@ -209,6 +210,12 @@ | selected <- consecutive r n (map (go rs ns) xs) ] +-- | Generalization of 'subs' allowing for non-default stride+subsWithStride ::+ Vec n Int -- ^ Stride+ -> Size n -> Tensor n a -> Tensor n (Tensor n a)+subsWithStride stride sz = applyStride stride . subs sz+ -- | Apply stride. -- -- This is the N-dimensional equivalent of 'everyNth'.@@ -237,7 +244,7 @@ -> Tensor n a -- ^ Input -> Tensor n a convolveWithStride stride kernel input =- aux <$> applyStride stride (subs (size kernel) input)+ aux <$> subsWithStride stride (size kernel) input where aux :: Tensor n a -> a aux = Foldable.foldl' (+) 0 . zipWith (*) kernel
testing-tensor.cabal view
@@ -1,6 +1,6 @@ cabal-version: 3.0 name: testing-tensor-version: 0.1.1+version: 0.1.2 license: BSD-3-Clause license-file: LICENSE author: Edsko de Vries