1
0
mirror of https://github.com/tensorflow/haskell.git synced 2024-06-02 19:13:34 +02:00

More --pedantic

This commit is contained in:
Greg Steuck 2016-11-17 14:02:20 -08:00
parent c707f1670f
commit 840275d979
2 changed files with 3 additions and 5 deletions

View File

@ -406,7 +406,7 @@ toT = Tensor ValueKind
-- | Wrapper around `TensorFlow.GenOps.Core.slice` that builds vectors from scalars for
-- simple slicing operations.
flatSlice :: forall v1 t i . (TensorType t)
flatSlice :: forall v1 t . (TensorType t)
=> Tensor v1 t -- ^ __input__
-> Int32 -- ^ __begin__: specifies the offset into the first dimension of
-- 'input' to slice from.
@ -415,7 +415,7 @@ flatSlice :: forall v1 t i . (TensorType t)
-- are included in the slice (i.e. this is equivalent to setting
-- size = input.dim_size(0) - begin).
-> Tensor Value t -- ^ __output__
flatSlice input begin size = CoreOps.slice input (vector [begin]) (vector [size])
flatSlice t begin size = CoreOps.slice t (vector [begin]) (vector [size])
-- | The gradient function for an op type.

View File

@ -20,8 +20,7 @@ module TensorFlow.Test
import qualified Data.Vector as V
import Test.HUnit ((@?))
import Test.HUnit.Lang (Assertion(..))
import Test.HUnit.Lang (Assertion)
-- | Compares that the vectors are element-by-element equal within the given
-- tolerance. Raises an assertion and prints some information if not.
assertAllClose :: V.Vector Float -> V.Vector Float -> Assertion
@ -31,4 +30,3 @@ assertAllClose xs ys = all (<= tol) (V.zipWith absDiff xs ys) @?
where
absDiff x y = abs (x - y)
tol = 0.001 :: Float