{- This file was auto-generated from tensorflow/core/framework/tensor_description.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.Framework.TensorDescription (
        TensorDescription()
    ) 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.Framework.AllocationDescription
import qualified Proto.Tensorflow.Core.Framework.TensorShape
import qualified Proto.Tensorflow.Core.Framework.Types
{- | Fields :
     
         * 'Proto.Tensorflow.Core.Framework.TensorDescription_Fields.dtype' @:: Lens' TensorDescription Proto.Tensorflow.Core.Framework.Types.DataType@
         * 'Proto.Tensorflow.Core.Framework.TensorDescription_Fields.shape' @:: Lens' TensorDescription Proto.Tensorflow.Core.Framework.TensorShape.TensorShapeProto@
         * 'Proto.Tensorflow.Core.Framework.TensorDescription_Fields.maybe'shape' @:: Lens' TensorDescription (Prelude.Maybe Proto.Tensorflow.Core.Framework.TensorShape.TensorShapeProto)@
         * 'Proto.Tensorflow.Core.Framework.TensorDescription_Fields.allocationDescription' @:: Lens' TensorDescription Proto.Tensorflow.Core.Framework.AllocationDescription.AllocationDescription@
         * 'Proto.Tensorflow.Core.Framework.TensorDescription_Fields.maybe'allocationDescription' @:: Lens' TensorDescription (Prelude.Maybe Proto.Tensorflow.Core.Framework.AllocationDescription.AllocationDescription)@ -}
data TensorDescription
  = TensorDescription'_constructor {TensorDescription -> DataType
_TensorDescription'dtype :: !Proto.Tensorflow.Core.Framework.Types.DataType,
                                    TensorDescription -> Maybe TensorShapeProto
_TensorDescription'shape :: !(Prelude.Maybe Proto.Tensorflow.Core.Framework.TensorShape.TensorShapeProto),
                                    TensorDescription -> Maybe AllocationDescription
_TensorDescription'allocationDescription :: !(Prelude.Maybe Proto.Tensorflow.Core.Framework.AllocationDescription.AllocationDescription),
                                    TensorDescription -> FieldSet
_TensorDescription'_unknownFields :: !Data.ProtoLens.FieldSet}
  deriving stock (TensorDescription -> TensorDescription -> Bool
(TensorDescription -> TensorDescription -> Bool)
-> (TensorDescription -> TensorDescription -> Bool)
-> Eq TensorDescription
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TensorDescription -> TensorDescription -> Bool
$c/= :: TensorDescription -> TensorDescription -> Bool
== :: TensorDescription -> TensorDescription -> Bool
$c== :: TensorDescription -> TensorDescription -> Bool
Prelude.Eq, Eq TensorDescription
Eq TensorDescription =>
(TensorDescription -> TensorDescription -> Ordering)
-> (TensorDescription -> TensorDescription -> Bool)
-> (TensorDescription -> TensorDescription -> Bool)
-> (TensorDescription -> TensorDescription -> Bool)
-> (TensorDescription -> TensorDescription -> Bool)
-> (TensorDescription -> TensorDescription -> TensorDescription)
-> (TensorDescription -> TensorDescription -> TensorDescription)
-> Ord TensorDescription
TensorDescription -> TensorDescription -> Bool
TensorDescription -> TensorDescription -> Ordering
TensorDescription -> TensorDescription -> TensorDescription
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 :: TensorDescription -> TensorDescription -> TensorDescription
$cmin :: TensorDescription -> TensorDescription -> TensorDescription
max :: TensorDescription -> TensorDescription -> TensorDescription
$cmax :: TensorDescription -> TensorDescription -> TensorDescription
>= :: TensorDescription -> TensorDescription -> Bool
$c>= :: TensorDescription -> TensorDescription -> Bool
> :: TensorDescription -> TensorDescription -> Bool
$c> :: TensorDescription -> TensorDescription -> Bool
<= :: TensorDescription -> TensorDescription -> Bool
$c<= :: TensorDescription -> TensorDescription -> Bool
< :: TensorDescription -> TensorDescription -> Bool
$c< :: TensorDescription -> TensorDescription -> Bool
compare :: TensorDescription -> TensorDescription -> Ordering
$ccompare :: TensorDescription -> TensorDescription -> Ordering
$cp1Ord :: Eq TensorDescription
Prelude.Ord)
instance Prelude.Show TensorDescription where
  showsPrec :: Int -> TensorDescription -> ShowS
showsPrec _ __x :: TensorDescription
__x __s :: String
__s
    = Char -> ShowS
Prelude.showChar
        '{'
        (String -> ShowS
Prelude.showString
           (TensorDescription -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort TensorDescription
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField TensorDescription "dtype" Proto.Tensorflow.Core.Framework.Types.DataType where
  fieldOf :: Proxy# "dtype"
-> (DataType -> f DataType)
-> TensorDescription
-> f TensorDescription
fieldOf _
    = ((DataType -> f DataType)
 -> TensorDescription -> f TensorDescription)
-> ((DataType -> f DataType) -> DataType -> f DataType)
-> (DataType -> f DataType)
-> TensorDescription
-> f TensorDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TensorDescription -> DataType)
-> (TensorDescription -> DataType -> TensorDescription)
-> Lens TensorDescription TensorDescription DataType DataType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TensorDescription -> DataType
_TensorDescription'dtype
           (\ x__ :: TensorDescription
x__ y__ :: DataType
y__ -> TensorDescription
x__ {_TensorDescription'dtype :: DataType
_TensorDescription'dtype = DataType
y__}))
        (DataType -> f DataType) -> DataType -> f DataType
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField TensorDescription "shape" Proto.Tensorflow.Core.Framework.TensorShape.TensorShapeProto where
  fieldOf :: Proxy# "shape"
-> (TensorShapeProto -> f TensorShapeProto)
-> TensorDescription
-> f TensorDescription
fieldOf _
    = ((Maybe TensorShapeProto -> f (Maybe TensorShapeProto))
 -> TensorDescription -> f TensorDescription)
-> ((TensorShapeProto -> f TensorShapeProto)
    -> Maybe TensorShapeProto -> f (Maybe TensorShapeProto))
-> (TensorShapeProto -> f TensorShapeProto)
-> TensorDescription
-> f TensorDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TensorDescription -> Maybe TensorShapeProto)
-> (TensorDescription
    -> Maybe TensorShapeProto -> TensorDescription)
-> Lens
     TensorDescription
     TensorDescription
     (Maybe TensorShapeProto)
     (Maybe TensorShapeProto)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TensorDescription -> Maybe TensorShapeProto
_TensorDescription'shape
           (\ x__ :: TensorDescription
x__ y__ :: Maybe TensorShapeProto
y__ -> TensorDescription
x__ {_TensorDescription'shape :: Maybe TensorShapeProto
_TensorDescription'shape = Maybe TensorShapeProto
y__}))
        (TensorShapeProto -> Lens' (Maybe TensorShapeProto) TensorShapeProto
forall b. b -> Lens' (Maybe b) b
Data.ProtoLens.maybeLens TensorShapeProto
forall msg. Message msg => msg
Data.ProtoLens.defMessage)
instance Data.ProtoLens.Field.HasField TensorDescription "maybe'shape" (Prelude.Maybe Proto.Tensorflow.Core.Framework.TensorShape.TensorShapeProto) where
  fieldOf :: Proxy# "maybe'shape"
-> (Maybe TensorShapeProto -> f (Maybe TensorShapeProto))
-> TensorDescription
-> f TensorDescription
fieldOf _
    = ((Maybe TensorShapeProto -> f (Maybe TensorShapeProto))
 -> TensorDescription -> f TensorDescription)
-> ((Maybe TensorShapeProto -> f (Maybe TensorShapeProto))
    -> Maybe TensorShapeProto -> f (Maybe TensorShapeProto))
-> (Maybe TensorShapeProto -> f (Maybe TensorShapeProto))
-> TensorDescription
-> f TensorDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TensorDescription -> Maybe TensorShapeProto)
-> (TensorDescription
    -> Maybe TensorShapeProto -> TensorDescription)
-> Lens
     TensorDescription
     TensorDescription
     (Maybe TensorShapeProto)
     (Maybe TensorShapeProto)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TensorDescription -> Maybe TensorShapeProto
_TensorDescription'shape
           (\ x__ :: TensorDescription
x__ y__ :: Maybe TensorShapeProto
y__ -> TensorDescription
x__ {_TensorDescription'shape :: Maybe TensorShapeProto
_TensorDescription'shape = Maybe TensorShapeProto
y__}))
        (Maybe TensorShapeProto -> f (Maybe TensorShapeProto))
-> Maybe TensorShapeProto -> f (Maybe TensorShapeProto)
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField TensorDescription "allocationDescription" Proto.Tensorflow.Core.Framework.AllocationDescription.AllocationDescription where
  fieldOf :: Proxy# "allocationDescription"
-> (AllocationDescription -> f AllocationDescription)
-> TensorDescription
-> f TensorDescription
fieldOf _
    = ((Maybe AllocationDescription -> f (Maybe AllocationDescription))
 -> TensorDescription -> f TensorDescription)
-> ((AllocationDescription -> f AllocationDescription)
    -> Maybe AllocationDescription -> f (Maybe AllocationDescription))
-> (AllocationDescription -> f AllocationDescription)
-> TensorDescription
-> f TensorDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TensorDescription -> Maybe AllocationDescription)
-> (TensorDescription
    -> Maybe AllocationDescription -> TensorDescription)
-> Lens
     TensorDescription
     TensorDescription
     (Maybe AllocationDescription)
     (Maybe AllocationDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TensorDescription -> Maybe AllocationDescription
_TensorDescription'allocationDescription
           (\ x__ :: TensorDescription
x__ y__ :: Maybe AllocationDescription
y__
              -> TensorDescription
x__ {_TensorDescription'allocationDescription :: Maybe AllocationDescription
_TensorDescription'allocationDescription = Maybe AllocationDescription
y__}))
        (AllocationDescription
-> Lens' (Maybe AllocationDescription) AllocationDescription
forall b. b -> Lens' (Maybe b) b
Data.ProtoLens.maybeLens AllocationDescription
forall msg. Message msg => msg
Data.ProtoLens.defMessage)
instance Data.ProtoLens.Field.HasField TensorDescription "maybe'allocationDescription" (Prelude.Maybe Proto.Tensorflow.Core.Framework.AllocationDescription.AllocationDescription) where
  fieldOf :: Proxy# "maybe'allocationDescription"
-> (Maybe AllocationDescription -> f (Maybe AllocationDescription))
-> TensorDescription
-> f TensorDescription
fieldOf _
    = ((Maybe AllocationDescription -> f (Maybe AllocationDescription))
 -> TensorDescription -> f TensorDescription)
-> ((Maybe AllocationDescription
     -> f (Maybe AllocationDescription))
    -> Maybe AllocationDescription -> f (Maybe AllocationDescription))
-> (Maybe AllocationDescription -> f (Maybe AllocationDescription))
-> TensorDescription
-> f TensorDescription
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TensorDescription -> Maybe AllocationDescription)
-> (TensorDescription
    -> Maybe AllocationDescription -> TensorDescription)
-> Lens
     TensorDescription
     TensorDescription
     (Maybe AllocationDescription)
     (Maybe AllocationDescription)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TensorDescription -> Maybe AllocationDescription
_TensorDescription'allocationDescription
           (\ x__ :: TensorDescription
x__ y__ :: Maybe AllocationDescription
y__
              -> TensorDescription
x__ {_TensorDescription'allocationDescription :: Maybe AllocationDescription
_TensorDescription'allocationDescription = Maybe AllocationDescription
y__}))
        (Maybe AllocationDescription -> f (Maybe AllocationDescription))
-> Maybe AllocationDescription -> f (Maybe AllocationDescription)
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message TensorDescription where
  messageName :: Proxy TensorDescription -> Text
messageName _ = String -> Text
Data.Text.pack "tensorflow.TensorDescription"
  packedMessageDescriptor :: Proxy TensorDescription -> ByteString
packedMessageDescriptor _
    = "\n\
      \\DC1TensorDescription\DC2*\n\
      \\ENQdtype\CAN\SOH \SOH(\SO2\DC4.tensorflow.DataTypeR\ENQdtype\DC22\n\
      \\ENQshape\CAN\STX \SOH(\v2\FS.tensorflow.TensorShapeProtoR\ENQshape\DC2X\n\
      \\SYNallocation_description\CAN\EOT \SOH(\v2!.tensorflow.AllocationDescriptionR\NAKallocationDescription"
  packedFileDescriptor :: Proxy TensorDescription -> ByteString
packedFileDescriptor _ = ByteString
packedFileDescriptor
  fieldsByTag :: Map Tag (FieldDescriptor TensorDescription)
fieldsByTag
    = let
        dtype__field_descriptor :: FieldDescriptor TensorDescription
dtype__field_descriptor
          = String
-> FieldTypeDescriptor DataType
-> FieldAccessor TensorDescription DataType
-> FieldDescriptor TensorDescription
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "dtype"
              (ScalarField DataType -> FieldTypeDescriptor DataType
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField DataType
forall t. MessageEnum t => ScalarField t
Data.ProtoLens.EnumField ::
                 Data.ProtoLens.FieldTypeDescriptor Proto.Tensorflow.Core.Framework.Types.DataType)
              (WireDefault DataType
-> Lens TensorDescription TensorDescription DataType DataType
-> FieldAccessor TensorDescription DataType
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
                 WireDefault DataType
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "dtype" 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 @"dtype")) ::
              Data.ProtoLens.FieldDescriptor TensorDescription
        shape__field_descriptor :: FieldDescriptor TensorDescription
shape__field_descriptor
          = String
-> FieldTypeDescriptor TensorShapeProto
-> FieldAccessor TensorDescription TensorShapeProto
-> FieldDescriptor TensorDescription
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "shape"
              (MessageOrGroup -> FieldTypeDescriptor TensorShapeProto
forall value.
Message value =>
MessageOrGroup -> FieldTypeDescriptor value
Data.ProtoLens.MessageField MessageOrGroup
Data.ProtoLens.MessageType ::
                 Data.ProtoLens.FieldTypeDescriptor Proto.Tensorflow.Core.Framework.TensorShape.TensorShapeProto)
              (Lens
  TensorDescription
  TensorDescription
  (Maybe TensorShapeProto)
  (Maybe TensorShapeProto)
-> FieldAccessor TensorDescription TensorShapeProto
forall msg value.
Lens' msg (Maybe value) -> FieldAccessor msg value
Data.ProtoLens.OptionalField
                 (forall s a (f :: * -> *).
(HasField s "maybe'shape" 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'shape")) ::
              Data.ProtoLens.FieldDescriptor TensorDescription
        allocationDescription__field_descriptor :: FieldDescriptor TensorDescription
allocationDescription__field_descriptor
          = String
-> FieldTypeDescriptor AllocationDescription
-> FieldAccessor TensorDescription AllocationDescription
-> FieldDescriptor TensorDescription
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "allocation_description"
              (MessageOrGroup -> FieldTypeDescriptor AllocationDescription
forall value.
Message value =>
MessageOrGroup -> FieldTypeDescriptor value
Data.ProtoLens.MessageField MessageOrGroup
Data.ProtoLens.MessageType ::
                 Data.ProtoLens.FieldTypeDescriptor Proto.Tensorflow.Core.Framework.AllocationDescription.AllocationDescription)
              (Lens
  TensorDescription
  TensorDescription
  (Maybe AllocationDescription)
  (Maybe AllocationDescription)
-> FieldAccessor TensorDescription AllocationDescription
forall msg value.
Lens' msg (Maybe value) -> FieldAccessor msg value
Data.ProtoLens.OptionalField
                 (forall s a (f :: * -> *).
(HasField s "maybe'allocationDescription" 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'allocationDescription")) ::
              Data.ProtoLens.FieldDescriptor TensorDescription
      in
        [(Tag, FieldDescriptor TensorDescription)]
-> Map Tag (FieldDescriptor TensorDescription)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
          [(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor TensorDescription
dtype__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor TensorDescription
shape__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 4, FieldDescriptor TensorDescription
allocationDescription__field_descriptor)]
  unknownFields :: LensLike' f TensorDescription FieldSet
unknownFields
    = (TensorDescription -> FieldSet)
-> (TensorDescription -> FieldSet -> TensorDescription)
-> Lens' TensorDescription FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
        TensorDescription -> FieldSet
_TensorDescription'_unknownFields
        (\ x__ :: TensorDescription
x__ y__ :: FieldSet
y__ -> TensorDescription
x__ {_TensorDescription'_unknownFields :: FieldSet
_TensorDescription'_unknownFields = FieldSet
y__})
  defMessage :: TensorDescription
defMessage
    = $WTensorDescription'_constructor :: DataType
-> Maybe TensorShapeProto
-> Maybe AllocationDescription
-> FieldSet
-> TensorDescription
TensorDescription'_constructor
        {_TensorDescription'dtype :: DataType
_TensorDescription'dtype = DataType
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _TensorDescription'shape :: Maybe TensorShapeProto
_TensorDescription'shape = Maybe TensorShapeProto
forall a. Maybe a
Prelude.Nothing,
         _TensorDescription'allocationDescription :: Maybe AllocationDescription
_TensorDescription'allocationDescription = Maybe AllocationDescription
forall a. Maybe a
Prelude.Nothing,
         _TensorDescription'_unknownFields :: FieldSet
_TensorDescription'_unknownFields = []}
  parseMessage :: Parser TensorDescription
parseMessage
    = let
        loop ::
          TensorDescription
          -> Data.ProtoLens.Encoding.Bytes.Parser TensorDescription
        loop :: TensorDescription -> Parser TensorDescription
loop x :: TensorDescription
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]))))
                      TensorDescription -> Parser TensorDescription
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
                        (Setter TensorDescription TensorDescription FieldSet FieldSet
-> (FieldSet -> FieldSet) -> TensorDescription -> TensorDescription
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 TensorDescription TensorDescription FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) TensorDescription
x)
               else
                   do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                      case Word64
tag of
                        8 -> do DataType
y <- Parser DataType -> String -> Parser DataType
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       ((Int -> DataType) -> Parser Int -> Parser DataType
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.fmap
                                          Int -> DataType
forall a. Enum a => Int -> a
Prelude.toEnum
                                          ((Word64 -> Int) -> Parser Word64 -> Parser Int
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.fmap
                                             Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral
                                             Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt))
                                       "dtype"
                                TensorDescription -> Parser TensorDescription
loop (Setter TensorDescription TensorDescription DataType DataType
-> DataType -> TensorDescription -> TensorDescription
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "dtype" 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 @"dtype") DataType
y TensorDescription
x)
                        18
                          -> do TensorShapeProto
y <- Parser TensorShapeProto -> String -> Parser TensorShapeProto
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       (do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                           Int -> Parser TensorShapeProto -> Parser TensorShapeProto
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 TensorShapeProto
forall msg. Message msg => Parser msg
Data.ProtoLens.parseMessage)
                                       "shape"
                                TensorDescription -> Parser TensorDescription
loop (Setter
  TensorDescription
  TensorDescription
  TensorShapeProto
  TensorShapeProto
-> TensorShapeProto -> TensorDescription -> TensorDescription
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "shape" 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 @"shape") TensorShapeProto
y TensorDescription
x)
                        34
                          -> do AllocationDescription
y <- Parser AllocationDescription
-> String -> Parser AllocationDescription
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       (do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                           Int -> Parser AllocationDescription -> Parser AllocationDescription
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 AllocationDescription
forall msg. Message msg => Parser msg
Data.ProtoLens.parseMessage)
                                       "allocation_description"
                                TensorDescription -> Parser TensorDescription
loop
                                  (Setter
  TensorDescription
  TensorDescription
  AllocationDescription
  AllocationDescription
-> AllocationDescription -> TensorDescription -> TensorDescription
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set
                                     (forall s a (f :: * -> *).
(HasField s "allocationDescription" 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 @"allocationDescription") AllocationDescription
y TensorDescription
x)
                        wire :: Word64
wire
                          -> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
                                        Word64
wire
                                TensorDescription -> Parser TensorDescription
loop
                                  (Setter TensorDescription TensorDescription FieldSet FieldSet
-> (FieldSet -> FieldSet) -> TensorDescription -> TensorDescription
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 TensorDescription TensorDescription FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) TensorDescription
x)
      in
        Parser TensorDescription -> String -> Parser TensorDescription
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
          (do TensorDescription -> Parser TensorDescription
loop TensorDescription
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "TensorDescription"
  buildMessage :: TensorDescription -> Builder
buildMessage
    = \ _x :: TensorDescription
_x
        -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
             (let
                _v :: DataType
_v = FoldLike
  DataType TensorDescription TensorDescription DataType DataType
-> TensorDescription -> DataType
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "dtype" 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 @"dtype") TensorDescription
_x
              in
                if DataType -> DataType -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) DataType
_v DataType
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault then
                    Builder
forall a. Monoid a => a
Data.Monoid.mempty
                else
                    Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                      (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 8)
                      ((Int -> Builder) -> (DataType -> Int) -> DataType -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
                         ((Word64 -> Builder) -> (Int -> Word64) -> Int -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
                            Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt Int -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral)
                         DataType -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum
                         DataType
_v))
             (Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                (case
                     FoldLike
  (Maybe TensorShapeProto)
  TensorDescription
  TensorDescription
  (Maybe TensorShapeProto)
  (Maybe TensorShapeProto)
-> TensorDescription -> Maybe TensorShapeProto
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "maybe'shape" 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'shape") TensorDescription
_x
                 of
                   Prelude.Nothing -> Builder
forall a. Monoid a => a
Data.Monoid.mempty
                   (Prelude.Just _v :: TensorShapeProto
_v)
                     -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                          (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 18)
                          ((ByteString -> Builder)
-> (TensorShapeProto -> ByteString) -> TensorShapeProto -> 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))
                             TensorShapeProto -> ByteString
forall msg. Message msg => msg -> ByteString
Data.ProtoLens.encodeMessage
                             TensorShapeProto
_v))
                (Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                   (case
                        FoldLike
  (Maybe AllocationDescription)
  TensorDescription
  TensorDescription
  (Maybe AllocationDescription)
  (Maybe AllocationDescription)
-> TensorDescription -> Maybe AllocationDescription
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view
                          (forall s a (f :: * -> *).
(HasField s "maybe'allocationDescription" 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'allocationDescription") TensorDescription
_x
                    of
                      Prelude.Nothing -> Builder
forall a. Monoid a => a
Data.Monoid.mempty
                      (Prelude.Just _v :: AllocationDescription
_v)
                        -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                             (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 34)
                             ((ByteString -> Builder)
-> (AllocationDescription -> ByteString)
-> AllocationDescription
-> 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))
                                AllocationDescription -> ByteString
forall msg. Message msg => msg -> ByteString
Data.ProtoLens.encodeMessage
                                AllocationDescription
_v))
                   (FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
                      (FoldLike
  FieldSet TensorDescription TensorDescription FieldSet FieldSet
-> TensorDescription -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike
  FieldSet TensorDescription TensorDescription FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields TensorDescription
_x))))
instance Control.DeepSeq.NFData TensorDescription where
  rnf :: TensorDescription -> ()
rnf
    = \ x__ :: TensorDescription
x__
        -> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
             (TensorDescription -> FieldSet
_TensorDescription'_unknownFields TensorDescription
x__)
             (DataType -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                (TensorDescription -> DataType
_TensorDescription'dtype TensorDescription
x__)
                (Maybe TensorShapeProto -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                   (TensorDescription -> Maybe TensorShapeProto
_TensorDescription'shape TensorDescription
x__)
                   (Maybe AllocationDescription -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                      (TensorDescription -> Maybe AllocationDescription
_TensorDescription'allocationDescription TensorDescription
x__) ())))
packedFileDescriptor :: Data.ByteString.ByteString
packedFileDescriptor :: ByteString
packedFileDescriptor
  = "\n\
    \2tensorflow/core/framework/tensor_description.proto\DC2\n\
    \tensorflow\SUB6tensorflow/core/framework/allocation_description.proto\SUB,tensorflow/core/framework/tensor_shape.proto\SUB%tensorflow/core/framework/types.proto\"\205\SOH\n\
    \\DC1TensorDescription\DC2*\n\
    \\ENQdtype\CAN\SOH \SOH(\SO2\DC4.tensorflow.DataTypeR\ENQdtype\DC22\n\
    \\ENQshape\CAN\STX \SOH(\v2\FS.tensorflow.TensorShapeProtoR\ENQshape\DC2X\n\
    \\SYNallocation_description\CAN\EOT \SOH(\v2!.tensorflow.AllocationDescriptionR\NAKallocationDescriptionB\147\SOH\n\
    \\CANorg.tensorflow.frameworkB\ETBTensorDescriptionProtosP\SOHZYgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_description_go_proto\248\SOH\SOHJ\217\ETX\n\
    \\ACK\DC2\EOT\NUL\NUL\ETB\SOH\n\
    \\b\n\
    \\SOH\f\DC2\ETX\NUL\NUL\DC2\n\
    \\b\n\
    \\SOH\STX\DC2\ETX\STX\NUL\DC3\n\
    \\t\n\
    \\STX\ETX\NUL\DC2\ETX\EOT\NUL@\n\
    \\t\n\
    \\STX\ETX\SOH\DC2\ETX\ENQ\NUL6\n\
    \\t\n\
    \\STX\ETX\STX\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\NUL8\n\
    \\t\n\
    \\STX\b\b\DC2\ETX\t\NUL8\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\NUL1\n\
    \\t\n\
    \\STX\b\SOH\DC2\ETX\v\NUL1\n\
    \\b\n\
    \\SOH\b\DC2\ETX\f\NULp\n\
    \\t\n\
    \\STX\b\v\DC2\ETX\f\NULp\n\
    \\n\
    \\n\
    \\STX\EOT\NUL\DC2\EOT\SO\NUL\ETB\SOH\n\
    \\n\
    \\n\
    \\ETX\EOT\NUL\SOH\DC2\ETX\SO\b\EM\n\
    \+\n\
    \\EOT\EOT\NUL\STX\NUL\DC2\ETX\DLE\STX\NAK\SUB\RS Data type of tensor elements\n\
    \\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\ACK\DC2\ETX\DLE\STX\n\
    \\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\SOH\DC2\ETX\DLE\v\DLE\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\ETX\DC2\ETX\DLE\DC3\DC4\n\
    \#\n\
    \\EOT\EOT\NUL\STX\SOH\DC2\ETX\DC3\STX\GS\SUB\SYN Shape of the tensor.\n\
    \\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\SOH\ACK\DC2\ETX\DC3\STX\DC2\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\SOH\SOH\DC2\ETX\DC3\DC3\CAN\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\SOH\ETX\DC2\ETX\DC3\ESC\FS\n\
    \I\n\
    \\EOT\EOT\NUL\STX\STX\DC2\ETX\SYN\STX3\SUB< Information about the size and allocator used for the data\n\
    \\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\STX\ACK\DC2\ETX\SYN\STX\ETB\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\STX\SOH\DC2\ETX\SYN\CAN.\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\STX\ETX\DC2\ETX\SYN12b\ACKproto3"