@@ -66,7 +66,7 @@ genNetwork =
66 SCons ( h :: Sing h ) ( _ :: Sing hs ) ->
66 SCons ( h :: Sing h ) ( _ :: Sing hs ) ->
67 withSingI h $
67 withSingI h $
69− D1Sing l -> withKnownNat l $
69+ D1Sing l@SNat ->
70 Gen.choice [
70 Gen.choice [
71 pure (SomeNetwork (Tanh :~> rest :: Network ( Tanh ': layers ) ( h ': h ': hs )))
71 pure (SomeNetwork (Tanh :~> rest :: Network ( Tanh ': layers ) ( h ': h ': hs )))
72 , pure (SomeNetwork (Logit :~> rest :: Network ( Logit ': layers ) ( h ': h ': hs )))
72 , pure (SomeNetwork (Logit :~> rest :: Network ( Logit ': layers ) ( h ': h ': hs )))
@@ -87,7 +87,7 @@ genNetwork =
87 pure (SomeNetwork (Reshape :~> rest :: Network ( Reshape ': layers ) ( ('D2 inRows inCols) ': h ': hs )))
87 pure (SomeNetwork (Reshape :~> rest :: Network ( Reshape ': layers ) ( ('D2 inRows inCols) ': h ': hs )))
88 _ -> Gen.discard -- Doesn't occur
88 _ -> Gen.discard -- Doesn't occur
90− D2Sing r c -> withKnownNat r $ withKnownNat c $
90+ D2Sing r@SNat c@SNat ->
91 Gen.choice [
91 Gen.choice [
92 pure (SomeNetwork (Tanh :~> rest :: Network ( Tanh ': layers ) ( h ': h ': hs )))
92 pure (SomeNetwork (Tanh :~> rest :: Network ( Tanh ': layers ) ( h ': h ': hs )))
93 , pure (SomeNetwork (Logit :~> rest :: Network ( Logit ': layers ) ( h ': h ': hs )))
93 , pure (SomeNetwork (Logit :~> rest :: Network ( Logit ': layers ) ( h ': h ': hs )))
@@ -215,7 +215,7 @@ genNetwork =
215 pure (SomeNetwork (Pooling :~> rest :: Network ( Pooling kernelRows kernelCols strideRows strideCols ': layers ) ( ('D2 inRows inCols) ': h ': hs )))
215 pure (SomeNetwork (Pooling :~> rest :: Network ( Pooling kernelRows kernelCols strideRows strideCols ': layers ) ( ('D2 inRows inCols) ': h ': hs )))
216 _ -> Gen.discard -- Can't occur
216 _ -> Gen.discard -- Can't occur
218− D3Sing r c d -> withKnownNat d $ withKnownNat r $ withKnownNat c $
218+ D3Sing SNat SNat SNat ->
219 Gen.choice [
219 Gen.choice [
220 pure (SomeNetwork (Tanh :~> rest :: Network ( Tanh ': layers ) ( h ': h ': hs )))
220 pure (SomeNetwork (Tanh :~> rest :: Network ( Tanh ': layers ) ( h ': h ': hs )))
221 , pure (SomeNetwork (Logit :~> rest :: Network ( Logit ': layers ) ( h ': h ': hs )))
221 , pure (SomeNetwork (Logit :~> rest :: Network ( Logit ': layers ) ( h ': h ': hs )))
@@ -247,7 +247,7 @@ prop_auto_diff = withTests 10000 . property $ do
247oneUp :: forall shape m. ( Monad m, SingI shape ) => Gen.Gen m (S shape)
247oneUp :: forall shape m. ( Monad m, SingI shape ) => Gen.Gen m (S shape)
249 case ( sing :: Sing shape ) of
249 case ( sing :: Sing shape ) of
250− D1Sing l -> withKnownNat l $
250+ D1Sing SNat ->
251 let x = 0 :: S ( shape )
251 let x = 0 :: S ( shape )
252 in case x of
252 in case x of
253 ( S1D x' ) -> do
253 ( S1D x' ) -> do
@@ -259,7 +259,7 @@ oneUp =
259 VS.freeze ex'
259 VS.freeze ex'
260 maybe Gen.discard pure . fromStorable $ nx
260 maybe Gen.discard pure . fromStorable $ nx
262− D2Sing r c -> withKnownNat r $ withKnownNat c $
262+ D2Sing SNat SNat ->
263 let x = 0 :: S ( shape )
263 let x = 0 :: S ( shape )
264 in case x of
264 in case x of
265 ( S2D x' ) -> do
265 ( S2D x' ) -> do
@@ -271,7 +271,7 @@ oneUp =
271 VS.freeze ex'
271 VS.freeze ex'
272 maybe Gen.discard pure . fromStorable $ nx
272 maybe Gen.discard pure . fromStorable $ nx
274− D3Sing r c d -> withKnownNat r $ withKnownNat c $ withKnownNat d $
274+ D3Sing SNat SNat SNat ->
275 let x = 0 :: S ( shape )
275 let x = 0 :: S ( shape )
276 in case x of
276 in case x of
277 ( S3D x' ) -> do
277 ( S3D x' ) -> do