{- This file was auto-generated from tensorflow/core/example/example.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies, UndecidableInstances, GeneralizedNewtypeDeriving, MultiParamTypeClasses, FlexibleContexts, FlexibleInstances, PatternSynonyms, MagicHash, NoImplicitPrelude, DataKinds, BangPatterns, TypeApplications, OverloadedStrings, DerivingStrategies#-}
{-# OPTIONS_GHC -Wno-unused-imports#-}
{-# OPTIONS_GHC -Wno-duplicate-exports#-}
{-# OPTIONS_GHC -Wno-dodgy-exports#-}
module Proto.Tensorflow.Core.Example.Example (
        Example(), SequenceExample()
    ) where
import qualified Data.ProtoLens.Runtime.Control.DeepSeq as Control.DeepSeq
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Prism as Data.ProtoLens.Prism
import qualified Data.ProtoLens.Runtime.Prelude as Prelude
import qualified Data.ProtoLens.Runtime.Data.Int as Data.Int
import qualified Data.ProtoLens.Runtime.Data.Monoid as Data.Monoid
import qualified Data.ProtoLens.Runtime.Data.Word as Data.Word
import qualified Data.ProtoLens.Runtime.Data.ProtoLens as Data.ProtoLens
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Bytes as Data.ProtoLens.Encoding.Bytes
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Growing as Data.ProtoLens.Encoding.Growing
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Parser.Unsafe as Data.ProtoLens.Encoding.Parser.Unsafe
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Encoding.Wire as Data.ProtoLens.Encoding.Wire
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Field as Data.ProtoLens.Field
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Message.Enum as Data.ProtoLens.Message.Enum
import qualified Data.ProtoLens.Runtime.Data.ProtoLens.Service.Types as Data.ProtoLens.Service.Types
import qualified Data.ProtoLens.Runtime.Lens.Family2 as Lens.Family2
import qualified Data.ProtoLens.Runtime.Lens.Family2.Unchecked as Lens.Family2.Unchecked
import qualified Data.ProtoLens.Runtime.Data.Text as Data.Text
import qualified Data.ProtoLens.Runtime.Data.Map as Data.Map
import qualified Data.ProtoLens.Runtime.Data.ByteString as Data.ByteString
import qualified Data.ProtoLens.Runtime.Data.ByteString.Char8 as Data.ByteString.Char8
import qualified Data.ProtoLens.Runtime.Data.Text.Encoding as Data.Text.Encoding
import qualified Data.ProtoLens.Runtime.Data.Vector as Data.Vector
import qualified Data.ProtoLens.Runtime.Data.Vector.Generic as Data.Vector.Generic
import qualified Data.ProtoLens.Runtime.Data.Vector.Unboxed as Data.Vector.Unboxed
import qualified Data.ProtoLens.Runtime.Text.Read as Text.Read
import qualified Proto.Tensorflow.Core.Example.Feature
{- | Fields :
     
         * 'Proto.Tensorflow.Core.Example.Example_Fields.features' @:: Lens' Example Proto.Tensorflow.Core.Example.Feature.Features@
         * 'Proto.Tensorflow.Core.Example.Example_Fields.maybe'features' @:: Lens' Example (Prelude.Maybe Proto.Tensorflow.Core.Example.Feature.Features)@ -}
data Example
  = Example'_constructor {Example -> Maybe Features
_Example'features :: !(Prelude.Maybe Proto.Tensorflow.Core.Example.Feature.Features),
                          Example -> FieldSet
_Example'_unknownFields :: !Data.ProtoLens.FieldSet}
  deriving stock (Example -> Example -> Bool
(Example -> Example -> Bool)
-> (Example -> Example -> Bool) -> Eq Example
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Example -> Example -> Bool
$c/= :: Example -> Example -> Bool
== :: Example -> Example -> Bool
$c== :: Example -> Example -> Bool
Prelude.Eq, Eq Example
Eq Example =>
(Example -> Example -> Ordering)
-> (Example -> Example -> Bool)
-> (Example -> Example -> Bool)
-> (Example -> Example -> Bool)
-> (Example -> Example -> Bool)
-> (Example -> Example -> Example)
-> (Example -> Example -> Example)
-> Ord Example
Example -> Example -> Bool
Example -> Example -> Ordering
Example -> Example -> Example
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Example -> Example -> Example
$cmin :: Example -> Example -> Example
max :: Example -> Example -> Example
$cmax :: Example -> Example -> Example
>= :: Example -> Example -> Bool
$c>= :: Example -> Example -> Bool
> :: Example -> Example -> Bool
$c> :: Example -> Example -> Bool
<= :: Example -> Example -> Bool
$c<= :: Example -> Example -> Bool
< :: Example -> Example -> Bool
$c< :: Example -> Example -> Bool
compare :: Example -> Example -> Ordering
$ccompare :: Example -> Example -> Ordering
$cp1Ord :: Eq Example
Prelude.Ord)
instance Prelude.Show Example where
  showsPrec :: Int -> Example -> ShowS
showsPrec _ __x :: Example
__x __s :: String
__s
    = Char -> ShowS
Prelude.showChar
        '{'
        (String -> ShowS
Prelude.showString
           (Example -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort Example
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField Example "features" Proto.Tensorflow.Core.Example.Feature.Features where
  fieldOf :: Proxy# "features"
-> (Features -> f Features) -> Example -> f Example
fieldOf _
    = ((Maybe Features -> f (Maybe Features)) -> Example -> f Example)
-> ((Features -> f Features)
    -> Maybe Features -> f (Maybe Features))
-> (Features -> f Features)
-> Example
-> f Example
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((Example -> Maybe Features)
-> (Example -> Maybe Features -> Example)
-> Lens Example Example (Maybe Features) (Maybe Features)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           Example -> Maybe Features
_Example'features (\ x__ :: Example
x__ y__ :: Maybe Features
y__ -> Example
x__ {_Example'features :: Maybe Features
_Example'features = Maybe Features
y__}))
        (Features -> Lens' (Maybe Features) Features
forall b. b -> Lens' (Maybe b) b
Data.ProtoLens.maybeLens Features
forall msg. Message msg => msg
Data.ProtoLens.defMessage)
instance Data.ProtoLens.Field.HasField Example "maybe'features" (Prelude.Maybe Proto.Tensorflow.Core.Example.Feature.Features) where
  fieldOf :: Proxy# "maybe'features"
-> (Maybe Features -> f (Maybe Features)) -> Example -> f Example
fieldOf _
    = ((Maybe Features -> f (Maybe Features)) -> Example -> f Example)
-> ((Maybe Features -> f (Maybe Features))
    -> Maybe Features -> f (Maybe Features))
-> (Maybe Features -> f (Maybe Features))
-> Example
-> f Example
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((Example -> Maybe Features)
-> (Example -> Maybe Features -> Example)
-> Lens Example Example (Maybe Features) (Maybe Features)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           Example -> Maybe Features
_Example'features (\ x__ :: Example
x__ y__ :: Maybe Features
y__ -> Example
x__ {_Example'features :: Maybe Features
_Example'features = Maybe Features
y__}))
        (Maybe Features -> f (Maybe Features))
-> Maybe Features -> f (Maybe Features)
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message Example where
  messageName :: Proxy Example -> Text
messageName _ = String -> Text
Data.Text.pack "tensorflow.Example"
  packedMessageDescriptor :: Proxy Example -> ByteString
packedMessageDescriptor _
    = "\n\
      \\aExample\DC20\n\
      \\bfeatures\CAN\SOH \SOH(\v2\DC4.tensorflow.FeaturesR\bfeatures"
  packedFileDescriptor :: Proxy Example -> ByteString
packedFileDescriptor _ = ByteString
packedFileDescriptor
  fieldsByTag :: Map Tag (FieldDescriptor Example)
fieldsByTag
    = let
        features__field_descriptor :: FieldDescriptor Example
features__field_descriptor
          = String
-> FieldTypeDescriptor Features
-> FieldAccessor Example Features
-> FieldDescriptor Example
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "features"
              (MessageOrGroup -> FieldTypeDescriptor Features
forall value.
Message value =>
MessageOrGroup -> FieldTypeDescriptor value
Data.ProtoLens.MessageField MessageOrGroup
Data.ProtoLens.MessageType ::
                 Data.ProtoLens.FieldTypeDescriptor Proto.Tensorflow.Core.Example.Feature.Features)
              (Lens Example Example (Maybe Features) (Maybe Features)
-> FieldAccessor Example Features
forall msg value.
Lens' msg (Maybe value) -> FieldAccessor msg value
Data.ProtoLens.OptionalField
                 (forall s a (f :: * -> *).
(HasField s "maybe'features" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"maybe'features")) ::
              Data.ProtoLens.FieldDescriptor Example
      in
        [(Tag, FieldDescriptor Example)]
-> Map Tag (FieldDescriptor Example)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
          [(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor Example
features__field_descriptor)]
  unknownFields :: LensLike' f Example FieldSet
unknownFields
    = (Example -> FieldSet)
-> (Example -> FieldSet -> Example) -> Lens' Example FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
        Example -> FieldSet
_Example'_unknownFields
        (\ x__ :: Example
x__ y__ :: FieldSet
y__ -> Example
x__ {_Example'_unknownFields :: FieldSet
_Example'_unknownFields = FieldSet
y__})
  defMessage :: Example
defMessage
    = $WExample'_constructor :: Maybe Features -> FieldSet -> Example
Example'_constructor
        {_Example'features :: Maybe Features
_Example'features = Maybe Features
forall a. Maybe a
Prelude.Nothing, _Example'_unknownFields :: FieldSet
_Example'_unknownFields = []}
  parseMessage :: Parser Example
parseMessage
    = let
        loop :: Example -> Data.ProtoLens.Encoding.Bytes.Parser Example
        loop :: Example -> Parser Example
loop x :: Example
x
          = do Bool
end <- Parser Bool
Data.ProtoLens.Encoding.Bytes.atEnd
               if Bool
end then
                   do (let missing :: [a]
missing = []
                       in
                         if [Any] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
Prelude.null [Any]
forall a. [a]
missing then
                             () -> Parser ()
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return ()
                         else
                             String -> Parser ()
forall (m :: * -> *) a. MonadFail m => String -> m a
Prelude.fail
                               (String -> ShowS
forall a. [a] -> [a] -> [a]
(Prelude.++)
                                  "Missing required fields: "
                                  ([String] -> String
forall a. Show a => a -> String
Prelude.show ([String]
forall a. [a]
missing :: [Prelude.String]))))
                      Example -> Parser Example
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
                        (Setter Example Example FieldSet FieldSet
-> (FieldSet -> FieldSet) -> Example -> Example
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
                           forall msg. Message msg => Lens' msg FieldSet
Setter Example Example FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) Example
x)
               else
                   do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                      case Word64
tag of
                        10
                          -> do Features
y <- Parser Features -> String -> Parser Features
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       (do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                           Int -> Parser Features -> Parser Features
forall a. Int -> Parser a -> Parser a
Data.ProtoLens.Encoding.Bytes.isolate
                                             (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Word64
len) Parser Features
forall msg. Message msg => Parser msg
Data.ProtoLens.parseMessage)
                                       "features"
                                Example -> Parser Example
loop
                                  (Setter Example Example Features Features
-> Features -> Example -> Example
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "features" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"features") Features
y Example
x)
                        wire :: Word64
wire
                          -> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
                                        Word64
wire
                                Example -> Parser Example
loop
                                  (Setter Example Example FieldSet FieldSet
-> (FieldSet -> FieldSet) -> Example -> Example
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
                                     forall msg. Message msg => Lens' msg FieldSet
Setter Example Example FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) Example
x)
      in
        Parser Example -> String -> Parser Example
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
          (do Example -> Parser Example
loop Example
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "Example"
  buildMessage :: Example -> Builder
buildMessage
    = \ _x :: Example
_x
        -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
             (case
                  FoldLike
  (Maybe Features) Example Example (Maybe Features) (Maybe Features)
-> Example -> Maybe Features
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "maybe'features" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"maybe'features") Example
_x
              of
                Prelude.Nothing -> Builder
forall a. Monoid a => a
Data.Monoid.mempty
                (Prelude.Just _v :: Features
_v)
                  -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                       (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 10)
                       ((ByteString -> Builder)
-> (Features -> ByteString) -> Features -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
                          (\ bs :: ByteString
bs
                             -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                                  (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt
                                     (Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral (ByteString -> Int
Data.ByteString.length ByteString
bs)))
                                  (ByteString -> Builder
Data.ProtoLens.Encoding.Bytes.putBytes ByteString
bs))
                          Features -> ByteString
forall msg. Message msg => msg -> ByteString
Data.ProtoLens.encodeMessage
                          Features
_v))
             (FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
                (FoldLike FieldSet Example Example FieldSet FieldSet
-> Example -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike FieldSet Example Example FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields Example
_x))
instance Control.DeepSeq.NFData Example where
  rnf :: Example -> ()
rnf
    = \ x__ :: Example
x__
        -> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
             (Example -> FieldSet
_Example'_unknownFields Example
x__)
             (Maybe Features -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (Example -> Maybe Features
_Example'features Example
x__) ())
{- | Fields :
     
         * 'Proto.Tensorflow.Core.Example.Example_Fields.context' @:: Lens' SequenceExample Proto.Tensorflow.Core.Example.Feature.Features@
         * 'Proto.Tensorflow.Core.Example.Example_Fields.maybe'context' @:: Lens' SequenceExample (Prelude.Maybe Proto.Tensorflow.Core.Example.Feature.Features)@
         * 'Proto.Tensorflow.Core.Example.Example_Fields.featureLists' @:: Lens' SequenceExample Proto.Tensorflow.Core.Example.Feature.FeatureLists@
         * 'Proto.Tensorflow.Core.Example.Example_Fields.maybe'featureLists' @:: Lens' SequenceExample (Prelude.Maybe Proto.Tensorflow.Core.Example.Feature.FeatureLists)@ -}
data SequenceExample
  = SequenceExample'_constructor {SequenceExample -> Maybe Features
_SequenceExample'context :: !(Prelude.Maybe Proto.Tensorflow.Core.Example.Feature.Features),
                                  SequenceExample -> Maybe FeatureLists
_SequenceExample'featureLists :: !(Prelude.Maybe Proto.Tensorflow.Core.Example.Feature.FeatureLists),
                                  SequenceExample -> FieldSet
_SequenceExample'_unknownFields :: !Data.ProtoLens.FieldSet}
  deriving stock (SequenceExample -> SequenceExample -> Bool
(SequenceExample -> SequenceExample -> Bool)
-> (SequenceExample -> SequenceExample -> Bool)
-> Eq SequenceExample
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SequenceExample -> SequenceExample -> Bool
$c/= :: SequenceExample -> SequenceExample -> Bool
== :: SequenceExample -> SequenceExample -> Bool
$c== :: SequenceExample -> SequenceExample -> Bool
Prelude.Eq, Eq SequenceExample
Eq SequenceExample =>
(SequenceExample -> SequenceExample -> Ordering)
-> (SequenceExample -> SequenceExample -> Bool)
-> (SequenceExample -> SequenceExample -> Bool)
-> (SequenceExample -> SequenceExample -> Bool)
-> (SequenceExample -> SequenceExample -> Bool)
-> (SequenceExample -> SequenceExample -> SequenceExample)
-> (SequenceExample -> SequenceExample -> SequenceExample)
-> Ord SequenceExample
SequenceExample -> SequenceExample -> Bool
SequenceExample -> SequenceExample -> Ordering
SequenceExample -> SequenceExample -> SequenceExample
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: SequenceExample -> SequenceExample -> SequenceExample
$cmin :: SequenceExample -> SequenceExample -> SequenceExample
max :: SequenceExample -> SequenceExample -> SequenceExample
$cmax :: SequenceExample -> SequenceExample -> SequenceExample
>= :: SequenceExample -> SequenceExample -> Bool
$c>= :: SequenceExample -> SequenceExample -> Bool
> :: SequenceExample -> SequenceExample -> Bool
$c> :: SequenceExample -> SequenceExample -> Bool
<= :: SequenceExample -> SequenceExample -> Bool
$c<= :: SequenceExample -> SequenceExample -> Bool
< :: SequenceExample -> SequenceExample -> Bool
$c< :: SequenceExample -> SequenceExample -> Bool
compare :: SequenceExample -> SequenceExample -> Ordering
$ccompare :: SequenceExample -> SequenceExample -> Ordering
$cp1Ord :: Eq SequenceExample
Prelude.Ord)
instance Prelude.Show SequenceExample where
  showsPrec :: Int -> SequenceExample -> ShowS
showsPrec _ __x :: SequenceExample
__x __s :: String
__s
    = Char -> ShowS
Prelude.showChar
        '{'
        (String -> ShowS
Prelude.showString
           (SequenceExample -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort SequenceExample
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField SequenceExample "context" Proto.Tensorflow.Core.Example.Feature.Features where
  fieldOf :: Proxy# "context"
-> (Features -> f Features) -> SequenceExample -> f SequenceExample
fieldOf _
    = ((Maybe Features -> f (Maybe Features))
 -> SequenceExample -> f SequenceExample)
-> ((Features -> f Features)
    -> Maybe Features -> f (Maybe Features))
-> (Features -> f Features)
-> SequenceExample
-> f SequenceExample
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((SequenceExample -> Maybe Features)
-> (SequenceExample -> Maybe Features -> SequenceExample)
-> Lens
     SequenceExample SequenceExample (Maybe Features) (Maybe Features)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           SequenceExample -> Maybe Features
_SequenceExample'context
           (\ x__ :: SequenceExample
x__ y__ :: Maybe Features
y__ -> SequenceExample
x__ {_SequenceExample'context :: Maybe Features
_SequenceExample'context = Maybe Features
y__}))
        (Features -> Lens' (Maybe Features) Features
forall b. b -> Lens' (Maybe b) b
Data.ProtoLens.maybeLens Features
forall msg. Message msg => msg
Data.ProtoLens.defMessage)
instance Data.ProtoLens.Field.HasField SequenceExample "maybe'context" (Prelude.Maybe Proto.Tensorflow.Core.Example.Feature.Features) where
  fieldOf :: Proxy# "maybe'context"
-> (Maybe Features -> f (Maybe Features))
-> SequenceExample
-> f SequenceExample
fieldOf _
    = ((Maybe Features -> f (Maybe Features))
 -> SequenceExample -> f SequenceExample)
-> ((Maybe Features -> f (Maybe Features))
    -> Maybe Features -> f (Maybe Features))
-> (Maybe Features -> f (Maybe Features))
-> SequenceExample
-> f SequenceExample
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((SequenceExample -> Maybe Features)
-> (SequenceExample -> Maybe Features -> SequenceExample)
-> Lens
     SequenceExample SequenceExample (Maybe Features) (Maybe Features)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           SequenceExample -> Maybe Features
_SequenceExample'context
           (\ x__ :: SequenceExample
x__ y__ :: Maybe Features
y__ -> SequenceExample
x__ {_SequenceExample'context :: Maybe Features
_SequenceExample'context = Maybe Features
y__}))
        (Maybe Features -> f (Maybe Features))
-> Maybe Features -> f (Maybe Features)
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField SequenceExample "featureLists" Proto.Tensorflow.Core.Example.Feature.FeatureLists where
  fieldOf :: Proxy# "featureLists"
-> (FeatureLists -> f FeatureLists)
-> SequenceExample
-> f SequenceExample
fieldOf _
    = ((Maybe FeatureLists -> f (Maybe FeatureLists))
 -> SequenceExample -> f SequenceExample)
-> ((FeatureLists -> f FeatureLists)
    -> Maybe FeatureLists -> f (Maybe FeatureLists))
-> (FeatureLists -> f FeatureLists)
-> SequenceExample
-> f SequenceExample
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((SequenceExample -> Maybe FeatureLists)
-> (SequenceExample -> Maybe FeatureLists -> SequenceExample)
-> Lens
     SequenceExample
     SequenceExample
     (Maybe FeatureLists)
     (Maybe FeatureLists)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           SequenceExample -> Maybe FeatureLists
_SequenceExample'featureLists
           (\ x__ :: SequenceExample
x__ y__ :: Maybe FeatureLists
y__ -> SequenceExample
x__ {_SequenceExample'featureLists :: Maybe FeatureLists
_SequenceExample'featureLists = Maybe FeatureLists
y__}))
        (FeatureLists -> Lens' (Maybe FeatureLists) FeatureLists
forall b. b -> Lens' (Maybe b) b
Data.ProtoLens.maybeLens FeatureLists
forall msg. Message msg => msg
Data.ProtoLens.defMessage)
instance Data.ProtoLens.Field.HasField SequenceExample "maybe'featureLists" (Prelude.Maybe Proto.Tensorflow.Core.Example.Feature.FeatureLists) where
  fieldOf :: Proxy# "maybe'featureLists"
-> (Maybe FeatureLists -> f (Maybe FeatureLists))
-> SequenceExample
-> f SequenceExample
fieldOf _
    = ((Maybe FeatureLists -> f (Maybe FeatureLists))
 -> SequenceExample -> f SequenceExample)
-> ((Maybe FeatureLists -> f (Maybe FeatureLists))
    -> Maybe FeatureLists -> f (Maybe FeatureLists))
-> (Maybe FeatureLists -> f (Maybe FeatureLists))
-> SequenceExample
-> f SequenceExample
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((SequenceExample -> Maybe FeatureLists)
-> (SequenceExample -> Maybe FeatureLists -> SequenceExample)
-> Lens
     SequenceExample
     SequenceExample
     (Maybe FeatureLists)
     (Maybe FeatureLists)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           SequenceExample -> Maybe FeatureLists
_SequenceExample'featureLists
           (\ x__ :: SequenceExample
x__ y__ :: Maybe FeatureLists
y__ -> SequenceExample
x__ {_SequenceExample'featureLists :: Maybe FeatureLists
_SequenceExample'featureLists = Maybe FeatureLists
y__}))
        (Maybe FeatureLists -> f (Maybe FeatureLists))
-> Maybe FeatureLists -> f (Maybe FeatureLists)
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message SequenceExample where
  messageName :: Proxy SequenceExample -> Text
messageName _ = String -> Text
Data.Text.pack "tensorflow.SequenceExample"
  packedMessageDescriptor :: Proxy SequenceExample -> ByteString
packedMessageDescriptor _
    = "\n\
      \\SISequenceExample\DC2.\n\
      \\acontext\CAN\SOH \SOH(\v2\DC4.tensorflow.FeaturesR\acontext\DC2=\n\
      \\rfeature_lists\CAN\STX \SOH(\v2\CAN.tensorflow.FeatureListsR\ffeatureLists"
  packedFileDescriptor :: Proxy SequenceExample -> ByteString
packedFileDescriptor _ = ByteString
packedFileDescriptor
  fieldsByTag :: Map Tag (FieldDescriptor SequenceExample)
fieldsByTag
    = let
        context__field_descriptor :: FieldDescriptor SequenceExample
context__field_descriptor
          = String
-> FieldTypeDescriptor Features
-> FieldAccessor SequenceExample Features
-> FieldDescriptor SequenceExample
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "context"
              (MessageOrGroup -> FieldTypeDescriptor Features
forall value.
Message value =>
MessageOrGroup -> FieldTypeDescriptor value
Data.ProtoLens.MessageField MessageOrGroup
Data.ProtoLens.MessageType ::
                 Data.ProtoLens.FieldTypeDescriptor Proto.Tensorflow.Core.Example.Feature.Features)
              (Lens
  SequenceExample SequenceExample (Maybe Features) (Maybe Features)
-> FieldAccessor SequenceExample Features
forall msg value.
Lens' msg (Maybe value) -> FieldAccessor msg value
Data.ProtoLens.OptionalField
                 (forall s a (f :: * -> *).
(HasField s "maybe'context" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"maybe'context")) ::
              Data.ProtoLens.FieldDescriptor SequenceExample
        featureLists__field_descriptor :: FieldDescriptor SequenceExample
featureLists__field_descriptor
          = String
-> FieldTypeDescriptor FeatureLists
-> FieldAccessor SequenceExample FeatureLists
-> FieldDescriptor SequenceExample
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "feature_lists"
              (MessageOrGroup -> FieldTypeDescriptor FeatureLists
forall value.
Message value =>
MessageOrGroup -> FieldTypeDescriptor value
Data.ProtoLens.MessageField MessageOrGroup
Data.ProtoLens.MessageType ::
                 Data.ProtoLens.FieldTypeDescriptor Proto.Tensorflow.Core.Example.Feature.FeatureLists)
              (Lens
  SequenceExample
  SequenceExample
  (Maybe FeatureLists)
  (Maybe FeatureLists)
-> FieldAccessor SequenceExample FeatureLists
forall msg value.
Lens' msg (Maybe value) -> FieldAccessor msg value
Data.ProtoLens.OptionalField
                 (forall s a (f :: * -> *).
(HasField s "maybe'featureLists" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"maybe'featureLists")) ::
              Data.ProtoLens.FieldDescriptor SequenceExample
      in
        [(Tag, FieldDescriptor SequenceExample)]
-> Map Tag (FieldDescriptor SequenceExample)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
          [(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor SequenceExample
context__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor SequenceExample
featureLists__field_descriptor)]
  unknownFields :: LensLike' f SequenceExample FieldSet
unknownFields
    = (SequenceExample -> FieldSet)
-> (SequenceExample -> FieldSet -> SequenceExample)
-> Lens' SequenceExample FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
        SequenceExample -> FieldSet
_SequenceExample'_unknownFields
        (\ x__ :: SequenceExample
x__ y__ :: FieldSet
y__ -> SequenceExample
x__ {_SequenceExample'_unknownFields :: FieldSet
_SequenceExample'_unknownFields = FieldSet
y__})
  defMessage :: SequenceExample
defMessage
    = $WSequenceExample'_constructor :: Maybe Features -> Maybe FeatureLists -> FieldSet -> SequenceExample
SequenceExample'_constructor
        {_SequenceExample'context :: Maybe Features
_SequenceExample'context = Maybe Features
forall a. Maybe a
Prelude.Nothing,
         _SequenceExample'featureLists :: Maybe FeatureLists
_SequenceExample'featureLists = Maybe FeatureLists
forall a. Maybe a
Prelude.Nothing,
         _SequenceExample'_unknownFields :: FieldSet
_SequenceExample'_unknownFields = []}
  parseMessage :: Parser SequenceExample
parseMessage
    = let
        loop ::
          SequenceExample
          -> Data.ProtoLens.Encoding.Bytes.Parser SequenceExample
        loop :: SequenceExample -> Parser SequenceExample
loop x :: SequenceExample
x
          = do Bool
end <- Parser Bool
Data.ProtoLens.Encoding.Bytes.atEnd
               if Bool
end then
                   do (let missing :: [a]
missing = []
                       in
                         if [Any] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
Prelude.null [Any]
forall a. [a]
missing then
                             () -> Parser ()
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return ()
                         else
                             String -> Parser ()
forall (m :: * -> *) a. MonadFail m => String -> m a
Prelude.fail
                               (String -> ShowS
forall a. [a] -> [a] -> [a]
(Prelude.++)
                                  "Missing required fields: "
                                  ([String] -> String
forall a. Show a => a -> String
Prelude.show ([String]
forall a. [a]
missing :: [Prelude.String]))))
                      SequenceExample -> Parser SequenceExample
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
                        (Setter SequenceExample SequenceExample FieldSet FieldSet
-> (FieldSet -> FieldSet) -> SequenceExample -> SequenceExample
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
                           forall msg. Message msg => Lens' msg FieldSet
Setter SequenceExample SequenceExample FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) SequenceExample
x)
               else
                   do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                      case Word64
tag of
                        10
                          -> do Features
y <- Parser Features -> String -> Parser Features
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       (do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                           Int -> Parser Features -> Parser Features
forall a. Int -> Parser a -> Parser a
Data.ProtoLens.Encoding.Bytes.isolate
                                             (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Word64
len) Parser Features
forall msg. Message msg => Parser msg
Data.ProtoLens.parseMessage)
                                       "context"
                                SequenceExample -> Parser SequenceExample
loop (Setter SequenceExample SequenceExample Features Features
-> Features -> SequenceExample -> SequenceExample
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "context" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"context") Features
y SequenceExample
x)
                        18
                          -> do FeatureLists
y <- Parser FeatureLists -> String -> Parser FeatureLists
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       (do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                           Int -> Parser FeatureLists -> Parser FeatureLists
forall a. Int -> Parser a -> Parser a
Data.ProtoLens.Encoding.Bytes.isolate
                                             (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Word64
len) Parser FeatureLists
forall msg. Message msg => Parser msg
Data.ProtoLens.parseMessage)
                                       "feature_lists"
                                SequenceExample -> Parser SequenceExample
loop
                                  (Setter SequenceExample SequenceExample FeatureLists FeatureLists
-> FeatureLists -> SequenceExample -> SequenceExample
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set
                                     (forall s a (f :: * -> *).
(HasField s "featureLists" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"featureLists") FeatureLists
y SequenceExample
x)
                        wire :: Word64
wire
                          -> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
                                        Word64
wire
                                SequenceExample -> Parser SequenceExample
loop
                                  (Setter SequenceExample SequenceExample FieldSet FieldSet
-> (FieldSet -> FieldSet) -> SequenceExample -> SequenceExample
forall s t a b. Setter s t a b -> (a -> b) -> s -> t
Lens.Family2.over
                                     forall msg. Message msg => Lens' msg FieldSet
Setter SequenceExample SequenceExample FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) SequenceExample
x)
      in
        Parser SequenceExample -> String -> Parser SequenceExample
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
          (do SequenceExample -> Parser SequenceExample
loop SequenceExample
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "SequenceExample"
  buildMessage :: SequenceExample -> Builder
buildMessage
    = \ _x :: SequenceExample
_x
        -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
             (case
                  FoldLike
  (Maybe Features)
  SequenceExample
  SequenceExample
  (Maybe Features)
  (Maybe Features)
-> SequenceExample -> Maybe Features
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "maybe'context" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"maybe'context") SequenceExample
_x
              of
                Prelude.Nothing -> Builder
forall a. Monoid a => a
Data.Monoid.mempty
                (Prelude.Just _v :: Features
_v)
                  -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                       (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 10)
                       ((ByteString -> Builder)
-> (Features -> ByteString) -> Features -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
                          (\ bs :: ByteString
bs
                             -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                                  (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt
                                     (Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral (ByteString -> Int
Data.ByteString.length ByteString
bs)))
                                  (ByteString -> Builder
Data.ProtoLens.Encoding.Bytes.putBytes ByteString
bs))
                          Features -> ByteString
forall msg. Message msg => msg -> ByteString
Data.ProtoLens.encodeMessage
                          Features
_v))
             (Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                (case
                     FoldLike
  (Maybe FeatureLists)
  SequenceExample
  SequenceExample
  (Maybe FeatureLists)
  (Maybe FeatureLists)
-> SequenceExample -> Maybe FeatureLists
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view
                       (forall s a (f :: * -> *).
(HasField s "maybe'featureLists" a, Functor f) =>
(a -> f a) -> s -> f s
forall (x :: Symbol) s a (f :: * -> *).
(HasField s x a, Functor f) =>
(a -> f a) -> s -> f s
Data.ProtoLens.Field.field @"maybe'featureLists") SequenceExample
_x
                 of
                   Prelude.Nothing -> Builder
forall a. Monoid a => a
Data.Monoid.mempty
                   (Prelude.Just _v :: FeatureLists
_v)
                     -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                          (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 18)
                          ((ByteString -> Builder)
-> (FeatureLists -> ByteString) -> FeatureLists -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
                             (\ bs :: ByteString
bs
                                -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                                     (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt
                                        (Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral (ByteString -> Int
Data.ByteString.length ByteString
bs)))
                                     (ByteString -> Builder
Data.ProtoLens.Encoding.Bytes.putBytes ByteString
bs))
                             FeatureLists -> ByteString
forall msg. Message msg => msg -> ByteString
Data.ProtoLens.encodeMessage
                             FeatureLists
_v))
                (FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
                   (FoldLike FieldSet SequenceExample SequenceExample FieldSet FieldSet
-> SequenceExample -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike FieldSet SequenceExample SequenceExample FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields SequenceExample
_x)))
instance Control.DeepSeq.NFData SequenceExample where
  rnf :: SequenceExample -> ()
rnf
    = \ x__ :: SequenceExample
x__
        -> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
             (SequenceExample -> FieldSet
_SequenceExample'_unknownFields SequenceExample
x__)
             (Maybe Features -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                (SequenceExample -> Maybe Features
_SequenceExample'context SequenceExample
x__)
                (Maybe FeatureLists -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (SequenceExample -> Maybe FeatureLists
_SequenceExample'featureLists SequenceExample
x__) ()))
packedFileDescriptor :: Data.ByteString.ByteString
packedFileDescriptor :: ByteString
packedFileDescriptor
  = "\n\
    \%tensorflow/core/example/example.proto\DC2\n\
    \tensorflow\SUB%tensorflow/core/example/feature.proto\";\n\
    \\aExample\DC20\n\
    \\bfeatures\CAN\SOH \SOH(\v2\DC4.tensorflow.FeaturesR\bfeatures\"\128\SOH\n\
    \\SISequenceExample\DC2.\n\
    \\acontext\CAN\SOH \SOH(\v2\DC4.tensorflow.FeaturesR\acontext\DC2=\n\
    \\rfeature_lists\CAN\STX \SOH(\v2\CAN.tensorflow.FeatureListsR\ffeatureListsB\129\SOH\n\
    \\SYNorg.tensorflow.exampleB\rExampleProtosP\SOHZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/example/example_protos_go_proto\248\SOH\SOHJ\255N\n\
    \\a\DC2\ENQ\STX\NUL\174\STX\SOH\n\
    \s\n\
    \\SOH\f\DC2\ETX\STX\NUL\DC2\SUBi Protocol messages for describing input data Examples for machine learning\n\
    \ model training or inference.\n\
    \\n\
    \\b\n\
    \\SOH\STX\DC2\ETX\EOT\NUL\DC3\n\
    \\t\n\
    \\STX\ETX\NUL\DC2\ETX\ACK\NUL/\n\
    \\b\n\
    \\SOH\b\DC2\ETX\b\NUL\US\n\
    \\t\n\
    \\STX\b\US\DC2\ETX\b\NUL\US\n\
    \\b\n\
    \\SOH\b\DC2\ETX\t\NUL.\n\
    \\t\n\
    \\STX\b\b\DC2\ETX\t\NUL.\n\
    \\b\n\
    \\SOH\b\DC2\ETX\n\
    \\NUL\"\n\
    \\t\n\
    \\STX\b\n\
    \\DC2\ETX\n\
    \\NUL\"\n\
    \\b\n\
    \\SOH\b\DC2\ETX\v\NUL/\n\
    \\t\n\
    \\STX\b\SOH\DC2\ETX\v\NUL/\n\
    \\b\n\
    \\SOH\b\DC2\ETX\f\NULj\n\
    \\t\n\
    \\STX\b\v\DC2\ETX\f\NULj\n\
    \\170\SYN\n\
    \\STX\EOT\NUL\DC2\EOTY\NUL[\SOH2\157\SYN An Example is a mostly-normalized data format for storing data for\n\
    \ training and inference.  It contains a key-value store (features); where\n\
    \ each key (string) maps to a Feature message (which is oneof packed BytesList,\n\
    \ FloatList, or Int64List).  This flexible and compact format allows the\n\
    \ storage of large amounts of typed data, but requires that the data shape\n\
    \ and use be determined by the configuration files and parsers that are used to\n\
    \ read and write this format.  That is, the Example is mostly *not* a\n\
    \ self-describing format.  In TensorFlow, Examples are read in row-major\n\
    \ format, so any configuration that describes data with rank-2 or above\n\
    \ should keep this in mind.  For example, to store an M x N matrix of Bytes,\n\
    \ the BytesList must contain M*N bytes, with M rows of N contiguous values\n\
    \ each.  That is, the BytesList value must store the matrix as:\n\
    \     .... row 0 .... .... row 1 .... // ...........  // ... row M-1 ....\n\
    \\n\
    \ An Example for a movie recommendation application:\n\
    \   features {\n\
    \     feature {\n\
    \       key: \"age\"\n\
    \       value { float_list {\n\
    \         value: 29.0\n\
    \       }}\n\
    \     }\n\
    \     feature {\n\
    \       key: \"movie\"\n\
    \       value { bytes_list {\n\
    \         value: \"The Shawshank Redemption\"\n\
    \         value: \"Fight Club\"\n\
    \       }}\n\
    \     }\n\
    \     feature {\n\
    \       key: \"movie_ratings\"\n\
    \       value { float_list {\n\
    \         value: 9.0\n\
    \         value: 9.7\n\
    \       }}\n\
    \     }\n\
    \     feature {\n\
    \       key: \"suggestion\"\n\
    \       value { bytes_list {\n\
    \         value: \"Inception\"\n\
    \       }}\n\
    \     }\n\
    \     # Note that this feature exists to be used as a label in training.\n\
    \     # E.g., if training a logistic regression model to predict purchase\n\
    \     # probability in our learning tool we would set the label feature to\n\
    \     # \"suggestion_purchased\".\n\
    \     feature {\n\
    \       key: \"suggestion_purchased\"\n\
    \       value { float_list {\n\
    \         value: 1.0\n\
    \       }}\n\
    \     }\n\
    \     # Similar to \"suggestion_purchased\" above this feature exists to be used\n\
    \     # as a label in training.\n\
    \     # E.g., if training a linear regression model to predict purchase\n\
    \     # price in our learning tool we would set the label feature to\n\
    \     # \"purchase_price\".\n\
    \     feature {\n\
    \       key: \"purchase_price\"\n\
    \       value { float_list {\n\
    \         value: 9.99\n\
    \       }}\n\
    \     }\n\
    \  }\n\
    \\n\
    \ A conformant Example data set obeys the following conventions:\n\
    \   - If a Feature K exists in one example with data type T, it must be of\n\
    \       type T in all other examples when present. It may be omitted.\n\
    \   - The number of instances of Feature K list data may vary across examples,\n\
    \       depending on the requirements of the model.\n\
    \   - If a Feature K doesn't exist in an example, a K-specific default will be\n\
    \       used, if configured.\n\
    \   - If a Feature K exists in an example but contains no items, the intent\n\
    \       is considered to be an empty tensor and no default will be used.\n\
    \\n\
    \\n\
    \\n\
    \\ETX\EOT\NUL\SOH\DC2\ETXY\b\SI\n\
    \\v\n\
    \\EOT\EOT\NUL\STX\NUL\DC2\ETXZ\STX\CAN\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\ACK\DC2\ETXZ\STX\n\
    \\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\SOH\DC2\ETXZ\v\DC3\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\ETX\DC2\ETXZ\SYN\ETB\n\
    \\141\&5\n\
    \\STX\EOT\SOH\DC2\ACK\171\STX\NUL\174\STX\SOH2\254\&4 A SequenceExample is an Example representing one or more sequences, and\n\
    \ some context.  The context contains features which apply to the entire\n\
    \ example. The feature_lists contain a key, value map where each key is\n\
    \ associated with a repeated set of Features (a FeatureList).\n\
    \ A FeatureList thus represents the values of a feature identified by its key\n\
    \ over time / frames.\n\
    \\n\
    \ Below is a SequenceExample for a movie recommendation application recording a\n\
    \ sequence of ratings by a user. The time-independent features (\"locale\",\n\
    \ \"age\", \"favorites\") describing the user are part of the context. The sequence\n\
    \ of movies the user rated are part of the feature_lists. For each movie in the\n\
    \ sequence we have information on its name and actors and the user's rating.\n\
    \ This information is recorded in three separate feature_list(s).\n\
    \ In the example below there are only two movies. All three feature_list(s),\n\
    \ namely \"movie_ratings\", \"movie_names\", and \"actors\" have a feature value for\n\
    \ both movies. Note, that \"actors\" is itself a bytes_list with multiple\n\
    \ strings per movie.\n\
    \\n\
    \ context: {\n\
    \   feature: {\n\
    \     key  : \"locale\"\n\
    \     value: {\n\
    \       bytes_list: {\n\
    \         value: [ \"pt_BR\" ]\n\
    \       }\n\
    \     }\n\
    \   }\n\
    \   feature: {\n\
    \     key  : \"age\"\n\
    \     value: {\n\
    \       float_list: {\n\
    \         value: [ 19.0 ]\n\
    \       }\n\
    \     }\n\
    \   }\n\
    \   feature: {\n\
    \     key  : \"favorites\"\n\
    \     value: {\n\
    \       bytes_list: {\n\
    \         value: [ \"Majesty Rose\", \"Savannah Outen\", \"One Direction\" ]\n\
    \       }\n\
    \     }\n\
    \   }\n\
    \ }\n\
    \ feature_lists: {\n\
    \   feature_list: {\n\
    \     key  : \"movie_ratings\"\n\
    \     value: {\n\
    \       feature: {\n\
    \         float_list: {\n\
    \           value: [ 4.5 ]\n\
    \         }\n\
    \       }\n\
    \       feature: {\n\
    \         float_list: {\n\
    \           value: [ 5.0 ]\n\
    \         }\n\
    \       }\n\
    \     }\n\
    \   }\n\
    \   feature_list: {\n\
    \     key  : \"movie_names\"\n\
    \     value: {\n\
    \       feature: {\n\
    \         bytes_list: {\n\
    \           value: [ \"The Shawshank Redemption\" ]\n\
    \         }\n\
    \       }\n\
    \       feature: {\n\
    \         bytes_list: {\n\
    \           value: [ \"Fight Club\" ]\n\
    \         }\n\
    \       }\n\
    \     }\n\
    \   }\n\
    \   feature_list: {\n\
    \     key  : \"actors\"\n\
    \     value: {\n\
    \       feature: {\n\
    \         bytes_list: {\n\
    \           value: [ \"Tim Robbins\", \"Morgan Freeman\" ]\n\
    \         }\n\
    \       }\n\
    \       feature: {\n\
    \         bytes_list: {\n\
    \           value: [ \"Brad Pitt\", \"Edward Norton\", \"Helena Bonham Carter\" ]\n\
    \         }\n\
    \       }\n\
    \     }\n\
    \   }\n\
    \ }\n\
    \\n\
    \ A conformant SequenceExample data set obeys the following conventions:\n\
    \\n\
    \ Context:\n\
    \   - All conformant context features K must obey the same conventions as\n\
    \     a conformant Example's features (see above).\n\
    \ Feature lists:\n\
    \   - A FeatureList L may be missing in an example; it is up to the\n\
    \     parser configuration to determine if this is allowed or considered\n\
    \     an empty list (zero length).\n\
    \   - If a FeatureList L exists, it may be empty (zero length).\n\
    \   - If a FeatureList L is non-empty, all features within the FeatureList\n\
    \     must have the same data type T. Even across SequenceExamples, the type T\n\
    \     of the FeatureList identified by the same key must be the same. An entry\n\
    \     without any values may serve as an empty feature.\n\
    \   - If a FeatureList L is non-empty, it is up to the parser configuration\n\
    \     to determine if all features within the FeatureList must\n\
    \     have the same size.  The same holds for this FeatureList across multiple\n\
    \     examples.\n\
    \   - For sequence modeling, e.g.:\n\
    \        http://colah.github.io/posts/2015-08-Understanding-LSTMs/\n\
    \        https://github.com/tensorflow/nmt\n\
    \     the feature lists represent a sequence of frames.\n\
    \     In this scenario, all FeatureLists in a SequenceExample have the same\n\
    \     number of Feature messages, so that the ith element in each FeatureList\n\
    \     is part of the ith frame (or time step).\n\
    \ Examples of conformant and non-conformant examples' FeatureLists:\n\
    \\n\
    \ Conformant FeatureLists:\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { feature: { float_list: { value: [ 4.5 ] } }\n\
    \               feature: { float_list: { value: [ 5.0 ] } } }\n\
    \    } }\n\
    \\n\
    \ Non-conformant FeatureLists (mismatched types):\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { feature: { float_list: { value: [ 4.5 ] } }\n\
    \               feature: { int64_list: { value: [ 5 ] } } }\n\
    \    } }\n\
    \\n\
    \ Conditionally conformant FeatureLists, the parser configuration determines\n\
    \ if the feature sizes must match:\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { feature: { float_list: { value: [ 4.5 ] } }\n\
    \               feature: { float_list: { value: [ 5.0, 6.0 ] } } }\n\
    \    } }\n\
    \\n\
    \ Conformant pair of SequenceExample\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { feature: { float_list: { value: [ 4.5 ] } }\n\
    \               feature: { float_list: { value: [ 5.0 ] } } }\n\
    \    } }\n\
    \ and:\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { feature: { float_list: { value: [ 4.5 ] } }\n\
    \               feature: { float_list: { value: [ 5.0 ] } }\n\
    \               feature: { float_list: { value: [ 2.0 ] } } }\n\
    \    } }\n\
    \\n\
    \ Conformant pair of SequenceExample\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { feature: { float_list: { value: [ 4.5 ] } }\n\
    \               feature: { float_list: { value: [ 5.0 ] } } }\n\
    \    } }\n\
    \ and:\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { }\n\
    \    } }\n\
    \\n\
    \ Conditionally conformant pair of SequenceExample, the parser configuration\n\
    \ determines if the second feature_lists is consistent (zero-length) or\n\
    \ invalid (missing \"movie_ratings\"):\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { feature: { float_list: { value: [ 4.5 ] } }\n\
    \               feature: { float_list: { value: [ 5.0 ] } } }\n\
    \    } }\n\
    \ and:\n\
    \    feature_lists: { }\n\
    \\n\
    \ Non-conformant pair of SequenceExample (mismatched types)\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { feature: { float_list: { value: [ 4.5 ] } }\n\
    \               feature: { float_list: { value: [ 5.0 ] } } }\n\
    \    } }\n\
    \ and:\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { feature: { int64_list: { value: [ 4 ] } }\n\
    \               feature: { int64_list: { value: [ 5 ] } }\n\
    \               feature: { int64_list: { value: [ 2 ] } } }\n\
    \    } }\n\
    \\n\
    \ Conditionally conformant pair of SequenceExample; the parser configuration\n\
    \ determines if the feature sizes must match:\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { feature: { float_list: { value: [ 4.5 ] } }\n\
    \               feature: { float_list: { value: [ 5.0 ] } } }\n\
    \    } }\n\
    \ and:\n\
    \    feature_lists: { feature_list: {\n\
    \      key: \"movie_ratings\"\n\
    \      value: { feature: { float_list: { value: [ 4.0 ] } }\n\
    \               feature: { float_list: { value: [ 5.0, 3.0 ] } }\n\
    \    } }\n\
    \\n\
    \\v\n\
    \\ETX\EOT\SOH\SOH\DC2\EOT\171\STX\b\ETB\n\
    \\f\n\
    \\EOT\EOT\SOH\STX\NUL\DC2\EOT\172\STX\STX\ETB\n\
    \\r\n\
    \\ENQ\EOT\SOH\STX\NUL\ACK\DC2\EOT\172\STX\STX\n\
    \\n\
    \\r\n\
    \\ENQ\EOT\SOH\STX\NUL\SOH\DC2\EOT\172\STX\v\DC2\n\
    \\r\n\
    \\ENQ\EOT\SOH\STX\NUL\ETX\DC2\EOT\172\STX\NAK\SYN\n\
    \\f\n\
    \\EOT\EOT\SOH\STX\SOH\DC2\EOT\173\STX\STX!\n\
    \\r\n\
    \\ENQ\EOT\SOH\STX\SOH\ACK\DC2\EOT\173\STX\STX\SO\n\
    \\r\n\
    \\ENQ\EOT\SOH\STX\SOH\SOH\DC2\EOT\173\STX\SI\FS\n\
    \\r\n\
    \\ENQ\EOT\SOH\STX\SOH\ETX\DC2\EOT\173\STX\US b\ACKproto3"