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

Merge remote-tracking branch 'upstream/master' into mac-readme

This commit is contained in:
Judah Jacobson 2016-10-26 10:50:12 -07:00
commit 99d98630a6
2 changed files with 10 additions and 2 deletions

View File

@ -90,7 +90,9 @@ blackList =
, "DecodeCSV"
, "ParseExample"
, "ParseSingleSequenceExample"
, "RestoreV2"
, "Save"
, "SaveV2"
, "SaveSlices"
, "SymbolicGradient"
, "_ArrayToList"

View File

@ -63,8 +63,14 @@ instance Storable Tensor where
peek p = fmap Tensor (peek (castPtr p))
poke p (Tensor t) = poke (castPtr p) t
-- A synonym for the int64_t type, which is used in the TensorFlow API.
-- On some platforms it's `long`; on others (e.g., Mac OS X) it's `long long`;
-- and as far as Haskell is concerned, those are distinct types (`CLong` vs
-- `CLLong`).
type CInt64 = {#type int64_t #}
newTensor :: DataType
-> Ptr CLong -- dimensions array
-> Ptr CInt64 -- dimensions array
-> CInt -- num dimensions
-> Ptr () -- data
-> CULong -- data len
@ -82,7 +88,7 @@ tensorType t = toEnum . fromIntegral <$> {# call TF_TensorType as ^ #} t
numDims :: Tensor -> IO CInt
numDims = {# call TF_NumDims as ^ #}
dim :: Tensor -> CInt -> IO CLong
dim :: Tensor -> CInt -> IO CInt64
dim = {# call TF_Dim as ^ #}
tensorByteSize :: Tensor -> IO CULong