@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE TemplateHaskell #-}
23{-# LANGUAGE DataKinds #-}
34{-# LANGUAGE KindSignatures #-}
@@ -9,6 +10,10 @@ module Test.Grenade.Layers.Pooling where
910import Data.Proxy
1011import Data.Singletons ()
1112
13+#if MIN_VERSION_base(4,9,0)
14+import Data.Kind (Type)
15+#endif
16+
1217import GHC.TypeLits
1318import Grenade.Layers.Pooling
1419
@@ -16,7 +21,7 @@ import Hedgehog
1621
1722import Test.Hedgehog.Compat
1823
19−data OpaquePooling :: * where
24+data OpaquePooling :: Type where
2025 OpaquePooling :: (KnownNat kh, KnownNat kw, KnownNat sh, KnownNat sw) => Pooling kh kw sh sw -> OpaquePooling
2126
2227instance Show OpaquePooling where
@@ -24,10 +29,10 @@ instance Show OpaquePooling where
2429
2530genOpaquePooling :: Gen OpaquePooling
2631genOpaquePooling = do
27− Just kernelHeight <- someNatVal <$> choose 2 15
28− Just kernelWidth <- someNatVal <$> choose 2 15
29− Just strideHeight <- someNatVal <$> choose 2 15
30− Just strideWidth <- someNatVal <$> choose 2 15
32+ ~(Just kernelHeight) <- someNatVal <$> choose 2 15
33+ ~(Just kernelWidth ) <- someNatVal <$> choose 2 15
34+ ~(Just strideHeight) <- someNatVal <$> choose 2 15
35+ ~(Just strideWidth ) <- someNatVal <$> choose 2 15
3136
3237 case (kernelHeight, kernelWidth, strideHeight, strideWidth) of
3338 (SomeNat (_ :: Proxy kh), SomeNat (_ :: Proxy kw), SomeNat (_ :: Proxy sh), SomeNat (_ :: Proxy sw)) ->