tensors 0.1.3 → 0.1.4
raw patch · 3 files changed
+9/−1 lines, 3 filesdep +deepseqdep ~QuickCheckPVP ok
version bump matches the API change (PVP)
Dependencies added: deepseq
Dependency ranges changed: QuickCheck
API changes (from Hackage documentation)
+ Data.Tensor: class HasShape s
+ Data.Tensor: toRank :: HasShape s => Proxy s -> Int
+ Data.Tensor: toShape :: HasShape s => SShape s
+ Data.Tensor: toSize :: HasShape s => Proxy s -> Int
Files
- src/Data/Tensor.hs +1/−0
- src/Data/Tensor/Tensor.hs +4/−0
- tensors.cabal +4/−1
src/Data/Tensor.hs view
@@ -80,6 +80,7 @@ , Shape , shape , rank+ , HasShape(..) -- * Tensor Operation -- ** Reshape Tensor , reshape
src/Data/Tensor/Tensor.hs view
@@ -5,6 +5,7 @@ module Data.Tensor.Tensor where +import Control.DeepSeq import Data.List (intercalate) import Data.Proxy import Data.Tensor.Type@@ -53,6 +54,9 @@ let s = shape t r = toSize (Proxy :: Proxy s) in foldr (f . gx t s) b ([0..r-1] :: [Int])++instance (HasShape s, NFData a) => NFData (Tensor s a) where+ rnf = foldr (\_ -> rnf) () instance (HasShape s, Show n) => Show (Tensor s n) where show (Tensor f) = let s = unShape (toShape :: SShape s) in go 0 [] s (f s)
tensors.cabal view
@@ -1,6 +1,6 @@ cabal-version: 1.12 name: tensors-version: 0.1.3+version: 0.1.4 license: BSD3 license-file: LICENSE copyright: (c) 2018 Daniel YU@@ -36,6 +36,7 @@ -fno-warn-missing-signatures build-depends: base >=4.9 && <5,+ deepseq >=1.4.4.0 && <1.5, vector >=0.12.0.2 && <0.13 test-suite spec@@ -62,6 +63,7 @@ build-depends: QuickCheck >=2.11.1 && <2.14, base >=4.9 && <5,+ deepseq >=1.4.4.0 && <1.5, hspec ==2.*, reflection >=2.1.4 && <2.2, vector >=0.12.0.2 && <0.13@@ -90,4 +92,5 @@ build-depends: base >=4.9 && <5, criterion >=1.5.4.0 && <1.6,+ deepseq >=1.4.4.0 && <1.5, vector >=0.12.0.2 && <0.13