mirror of
https://github.com/tensorflow/haskell.git
synced 2024-11-27 05:19:45 +01:00
Fixed. Could not deduce (TensorType a)
This commit is contained in:
parent
665730d6bd
commit
5df9ac4086
1 changed files with 2 additions and 2 deletions
|
@ -262,7 +262,7 @@ instance TensorDataType S.Vector Bool where
|
|||
where
|
||||
fromBool x = if x then 1 else 0 :: Word8
|
||||
|
||||
instance {-# OVERLAPPABLE #-} (Storable a, TensorDataType S.Vector a)
|
||||
instance {-# OVERLAPPABLE #-} (TensorType a, Storable a, TensorDataType S.Vector a)
|
||||
=> TensorDataType V.Vector a where
|
||||
decodeTensorData = (S.convert :: S.Vector a -> V.Vector a) . decodeTensorData
|
||||
encodeTensorData x = encodeTensorData x . (S.convert :: V.Vector a -> S.Vector a)
|
||||
|
@ -329,7 +329,7 @@ newtype Scalar a = Scalar {unScalar :: a}
|
|||
deriving (Show, Eq, Ord, Num, Fractional, Floating, Real, RealFloat,
|
||||
RealFrac, IsString)
|
||||
|
||||
instance TensorDataType V.Vector a => TensorDataType Scalar a where
|
||||
instance (TensorType a, TensorDataType V.Vector a) => TensorDataType Scalar a where
|
||||
decodeTensorData = Scalar . headFromSingleton . decodeTensorData
|
||||
encodeTensorData x (Scalar y) = encodeTensorData x (V.fromList [y])
|
||||
|
||||
|
|
Loading…
Reference in a new issue