From c5bfff9b4c5507c30b11e4d0287e52b7c26485a5 Mon Sep 17 00:00:00 2001 From: Bart Schuurmans Date: Tue, 17 Jan 2023 17:22:50 +0100 Subject: [PATCH] WIP: Update byte layout for TF_String tensors --- tensorflow/src/TensorFlow/Types.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tensorflow/src/TensorFlow/Types.hs b/tensorflow/src/TensorFlow/Types.hs index 3ea73fb..714fbfa 100644 --- a/tensorflow/src/TensorFlow/Types.hs +++ b/tensorflow/src/TensorFlow/Types.hs @@ -322,6 +322,8 @@ instance {-# OVERLAPPING #-} TensorDataType V.Vector ByteString where -- at each element offset: -- string length :: VarInt64 -- string data :: [Word8] + -- TODO: According to the v2.4.0 release notes, the byte layout for string + -- tensors has been changed to a contiguous array of TF_TStrings. decodeTensorData tensorData = either (\err -> error $ "Malformed TF_STRING tensor; " ++ err) id $ if expected /= count