{- This file was auto-generated from tensorflow/core/framework/tensor_shape.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.TensorShape (
        TensorShapeProto(), TensorShapeProto'Dim()
    ) 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
{- | Fields :
     
         * 'Proto.Tensorflow.Core.Framework.TensorShape_Fields.dim' @:: Lens' TensorShapeProto [TensorShapeProto'Dim]@
         * 'Proto.Tensorflow.Core.Framework.TensorShape_Fields.vec'dim' @:: Lens' TensorShapeProto (Data.Vector.Vector TensorShapeProto'Dim)@
         * 'Proto.Tensorflow.Core.Framework.TensorShape_Fields.unknownRank' @:: Lens' TensorShapeProto Prelude.Bool@ -}
data TensorShapeProto
  = TensorShapeProto'_constructor {TensorShapeProto -> Vector TensorShapeProto'Dim
_TensorShapeProto'dim :: !(Data.Vector.Vector TensorShapeProto'Dim),
                                   TensorShapeProto -> Bool
_TensorShapeProto'unknownRank :: !Prelude.Bool,
                                   TensorShapeProto -> FieldSet
_TensorShapeProto'_unknownFields :: !Data.ProtoLens.FieldSet}
  deriving stock (TensorShapeProto -> TensorShapeProto -> Bool
(TensorShapeProto -> TensorShapeProto -> Bool)
-> (TensorShapeProto -> TensorShapeProto -> Bool)
-> Eq TensorShapeProto
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TensorShapeProto -> TensorShapeProto -> Bool
$c/= :: TensorShapeProto -> TensorShapeProto -> Bool
== :: TensorShapeProto -> TensorShapeProto -> Bool
$c== :: TensorShapeProto -> TensorShapeProto -> Bool
Prelude.Eq, Eq TensorShapeProto
Eq TensorShapeProto =>
(TensorShapeProto -> TensorShapeProto -> Ordering)
-> (TensorShapeProto -> TensorShapeProto -> Bool)
-> (TensorShapeProto -> TensorShapeProto -> Bool)
-> (TensorShapeProto -> TensorShapeProto -> Bool)
-> (TensorShapeProto -> TensorShapeProto -> Bool)
-> (TensorShapeProto -> TensorShapeProto -> TensorShapeProto)
-> (TensorShapeProto -> TensorShapeProto -> TensorShapeProto)
-> Ord TensorShapeProto
TensorShapeProto -> TensorShapeProto -> Bool
TensorShapeProto -> TensorShapeProto -> Ordering
TensorShapeProto -> TensorShapeProto -> TensorShapeProto
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 :: TensorShapeProto -> TensorShapeProto -> TensorShapeProto
$cmin :: TensorShapeProto -> TensorShapeProto -> TensorShapeProto
max :: TensorShapeProto -> TensorShapeProto -> TensorShapeProto
$cmax :: TensorShapeProto -> TensorShapeProto -> TensorShapeProto
>= :: TensorShapeProto -> TensorShapeProto -> Bool
$c>= :: TensorShapeProto -> TensorShapeProto -> Bool
> :: TensorShapeProto -> TensorShapeProto -> Bool
$c> :: TensorShapeProto -> TensorShapeProto -> Bool
<= :: TensorShapeProto -> TensorShapeProto -> Bool
$c<= :: TensorShapeProto -> TensorShapeProto -> Bool
< :: TensorShapeProto -> TensorShapeProto -> Bool
$c< :: TensorShapeProto -> TensorShapeProto -> Bool
compare :: TensorShapeProto -> TensorShapeProto -> Ordering
$ccompare :: TensorShapeProto -> TensorShapeProto -> Ordering
$cp1Ord :: Eq TensorShapeProto
Prelude.Ord)
instance Prelude.Show TensorShapeProto where
  showsPrec :: Int -> TensorShapeProto -> ShowS
showsPrec _ __x :: TensorShapeProto
__x __s :: String
__s
    = Char -> ShowS
Prelude.showChar
        '{'
        (String -> ShowS
Prelude.showString
           (TensorShapeProto -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort TensorShapeProto
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField TensorShapeProto "dim" [TensorShapeProto'Dim] where
  fieldOf :: Proxy# "dim"
-> ([TensorShapeProto'Dim] -> f [TensorShapeProto'Dim])
-> TensorShapeProto
-> f TensorShapeProto
fieldOf _
    = ((Vector TensorShapeProto'Dim -> f (Vector TensorShapeProto'Dim))
 -> TensorShapeProto -> f TensorShapeProto)
-> (([TensorShapeProto'Dim] -> f [TensorShapeProto'Dim])
    -> Vector TensorShapeProto'Dim -> f (Vector TensorShapeProto'Dim))
-> ([TensorShapeProto'Dim] -> f [TensorShapeProto'Dim])
-> TensorShapeProto
-> f TensorShapeProto
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TensorShapeProto -> Vector TensorShapeProto'Dim)
-> (TensorShapeProto
    -> Vector TensorShapeProto'Dim -> TensorShapeProto)
-> Lens
     TensorShapeProto
     TensorShapeProto
     (Vector TensorShapeProto'Dim)
     (Vector TensorShapeProto'Dim)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TensorShapeProto -> Vector TensorShapeProto'Dim
_TensorShapeProto'dim
           (\ x__ :: TensorShapeProto
x__ y__ :: Vector TensorShapeProto'Dim
y__ -> TensorShapeProto
x__ {_TensorShapeProto'dim :: Vector TensorShapeProto'Dim
_TensorShapeProto'dim = Vector TensorShapeProto'Dim
y__}))
        ((Vector TensorShapeProto'Dim -> [TensorShapeProto'Dim])
-> (Vector TensorShapeProto'Dim
    -> [TensorShapeProto'Dim] -> Vector TensorShapeProto'Dim)
-> Lens
     (Vector TensorShapeProto'Dim)
     (Vector TensorShapeProto'Dim)
     [TensorShapeProto'Dim]
     [TensorShapeProto'Dim]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           Vector TensorShapeProto'Dim -> [TensorShapeProto'Dim]
forall (v :: * -> *) a. Vector v a => v a -> [a]
Data.Vector.Generic.toList
           (\ _ y__ :: [TensorShapeProto'Dim]
y__ -> [TensorShapeProto'Dim] -> Vector TensorShapeProto'Dim
forall (v :: * -> *) a. Vector v a => [a] -> v a
Data.Vector.Generic.fromList [TensorShapeProto'Dim]
y__))
instance Data.ProtoLens.Field.HasField TensorShapeProto "vec'dim" (Data.Vector.Vector TensorShapeProto'Dim) where
  fieldOf :: Proxy# "vec'dim"
-> (Vector TensorShapeProto'Dim -> f (Vector TensorShapeProto'Dim))
-> TensorShapeProto
-> f TensorShapeProto
fieldOf _
    = ((Vector TensorShapeProto'Dim -> f (Vector TensorShapeProto'Dim))
 -> TensorShapeProto -> f TensorShapeProto)
-> ((Vector TensorShapeProto'Dim
     -> f (Vector TensorShapeProto'Dim))
    -> Vector TensorShapeProto'Dim -> f (Vector TensorShapeProto'Dim))
-> (Vector TensorShapeProto'Dim -> f (Vector TensorShapeProto'Dim))
-> TensorShapeProto
-> f TensorShapeProto
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TensorShapeProto -> Vector TensorShapeProto'Dim)
-> (TensorShapeProto
    -> Vector TensorShapeProto'Dim -> TensorShapeProto)
-> Lens
     TensorShapeProto
     TensorShapeProto
     (Vector TensorShapeProto'Dim)
     (Vector TensorShapeProto'Dim)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TensorShapeProto -> Vector TensorShapeProto'Dim
_TensorShapeProto'dim
           (\ x__ :: TensorShapeProto
x__ y__ :: Vector TensorShapeProto'Dim
y__ -> TensorShapeProto
x__ {_TensorShapeProto'dim :: Vector TensorShapeProto'Dim
_TensorShapeProto'dim = Vector TensorShapeProto'Dim
y__}))
        (Vector TensorShapeProto'Dim -> f (Vector TensorShapeProto'Dim))
-> Vector TensorShapeProto'Dim -> f (Vector TensorShapeProto'Dim)
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField TensorShapeProto "unknownRank" Prelude.Bool where
  fieldOf :: Proxy# "unknownRank"
-> (Bool -> f Bool) -> TensorShapeProto -> f TensorShapeProto
fieldOf _
    = ((Bool -> f Bool) -> TensorShapeProto -> f TensorShapeProto)
-> ((Bool -> f Bool) -> Bool -> f Bool)
-> (Bool -> f Bool)
-> TensorShapeProto
-> f TensorShapeProto
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TensorShapeProto -> Bool)
-> (TensorShapeProto -> Bool -> TensorShapeProto)
-> Lens TensorShapeProto TensorShapeProto Bool Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TensorShapeProto -> Bool
_TensorShapeProto'unknownRank
           (\ x__ :: TensorShapeProto
x__ y__ :: Bool
y__ -> TensorShapeProto
x__ {_TensorShapeProto'unknownRank :: Bool
_TensorShapeProto'unknownRank = Bool
y__}))
        (Bool -> f Bool) -> Bool -> f Bool
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message TensorShapeProto where
  messageName :: Proxy TensorShapeProto -> Text
messageName _ = String -> Text
Data.Text.pack "tensorflow.TensorShapeProto"
  packedMessageDescriptor :: Proxy TensorShapeProto -> ByteString
packedMessageDescriptor _
    = "\n\
      \\DLETensorShapeProto\DC22\n\
      \\ETXdim\CAN\STX \ETX(\v2 .tensorflow.TensorShapeProto.DimR\ETXdim\DC2!\n\
      \\funknown_rank\CAN\ETX \SOH(\bR\vunknownRank\SUB-\n\
      \\ETXDim\DC2\DC2\n\
      \\EOTsize\CAN\SOH \SOH(\ETXR\EOTsize\DC2\DC2\n\
      \\EOTname\CAN\STX \SOH(\tR\EOTname"
  packedFileDescriptor :: Proxy TensorShapeProto -> ByteString
packedFileDescriptor _ = ByteString
packedFileDescriptor
  fieldsByTag :: Map Tag (FieldDescriptor TensorShapeProto)
fieldsByTag
    = let
        dim__field_descriptor :: FieldDescriptor TensorShapeProto
dim__field_descriptor
          = String
-> FieldTypeDescriptor TensorShapeProto'Dim
-> FieldAccessor TensorShapeProto TensorShapeProto'Dim
-> FieldDescriptor TensorShapeProto
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "dim"
              (MessageOrGroup -> FieldTypeDescriptor TensorShapeProto'Dim
forall value.
Message value =>
MessageOrGroup -> FieldTypeDescriptor value
Data.ProtoLens.MessageField MessageOrGroup
Data.ProtoLens.MessageType ::
                 Data.ProtoLens.FieldTypeDescriptor TensorShapeProto'Dim)
              (Packing
-> Lens' TensorShapeProto [TensorShapeProto'Dim]
-> FieldAccessor TensorShapeProto TensorShapeProto'Dim
forall msg value.
Packing -> Lens' msg [value] -> FieldAccessor msg value
Data.ProtoLens.RepeatedField
                 Packing
Data.ProtoLens.Unpacked (forall s a (f :: * -> *).
(HasField s "dim" 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 @"dim")) ::
              Data.ProtoLens.FieldDescriptor TensorShapeProto
        unknownRank__field_descriptor :: FieldDescriptor TensorShapeProto
unknownRank__field_descriptor
          = String
-> FieldTypeDescriptor Bool
-> FieldAccessor TensorShapeProto Bool
-> FieldDescriptor TensorShapeProto
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "unknown_rank"
              (ScalarField Bool -> FieldTypeDescriptor Bool
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField Bool
Data.ProtoLens.BoolField ::
                 Data.ProtoLens.FieldTypeDescriptor Prelude.Bool)
              (WireDefault Bool
-> Lens TensorShapeProto TensorShapeProto Bool Bool
-> FieldAccessor TensorShapeProto Bool
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
                 WireDefault Bool
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional
                 (forall s a (f :: * -> *).
(HasField s "unknownRank" 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 @"unknownRank")) ::
              Data.ProtoLens.FieldDescriptor TensorShapeProto
      in
        [(Tag, FieldDescriptor TensorShapeProto)]
-> Map Tag (FieldDescriptor TensorShapeProto)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
          [(Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor TensorShapeProto
dim__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 3, FieldDescriptor TensorShapeProto
unknownRank__field_descriptor)]
  unknownFields :: LensLike' f TensorShapeProto FieldSet
unknownFields
    = (TensorShapeProto -> FieldSet)
-> (TensorShapeProto -> FieldSet -> TensorShapeProto)
-> Lens' TensorShapeProto FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
        TensorShapeProto -> FieldSet
_TensorShapeProto'_unknownFields
        (\ x__ :: TensorShapeProto
x__ y__ :: FieldSet
y__ -> TensorShapeProto
x__ {_TensorShapeProto'_unknownFields :: FieldSet
_TensorShapeProto'_unknownFields = FieldSet
y__})
  defMessage :: TensorShapeProto
defMessage
    = $WTensorShapeProto'_constructor :: Vector TensorShapeProto'Dim -> Bool -> FieldSet -> TensorShapeProto
TensorShapeProto'_constructor
        {_TensorShapeProto'dim :: Vector TensorShapeProto'Dim
_TensorShapeProto'dim = Vector TensorShapeProto'Dim
forall (v :: * -> *) a. Vector v a => v a
Data.Vector.Generic.empty,
         _TensorShapeProto'unknownRank :: Bool
_TensorShapeProto'unknownRank = Bool
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _TensorShapeProto'_unknownFields :: FieldSet
_TensorShapeProto'_unknownFields = []}
  parseMessage :: Parser TensorShapeProto
parseMessage
    = let
        loop ::
          TensorShapeProto
          -> Data.ProtoLens.Encoding.Growing.Growing Data.Vector.Vector Data.ProtoLens.Encoding.Growing.RealWorld TensorShapeProto'Dim
             -> Data.ProtoLens.Encoding.Bytes.Parser TensorShapeProto
        loop :: TensorShapeProto
-> Growing Vector RealWorld TensorShapeProto'Dim
-> Parser TensorShapeProto
loop x :: TensorShapeProto
x mutable'dim :: Growing Vector RealWorld TensorShapeProto'Dim
mutable'dim
          = do Bool
end <- Parser Bool
Data.ProtoLens.Encoding.Bytes.atEnd
               if Bool
end then
                   do Vector TensorShapeProto'Dim
frozen'dim <- IO (Vector TensorShapeProto'Dim)
-> Parser (Vector TensorShapeProto'Dim)
forall a. IO a -> Parser a
Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO
                                      (Growing Vector (PrimState IO) TensorShapeProto'Dim
-> IO (Vector TensorShapeProto'Dim)
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Growing v (PrimState m) a -> m (v a)
Data.ProtoLens.Encoding.Growing.unsafeFreeze Growing Vector RealWorld TensorShapeProto'Dim
Growing Vector (PrimState IO) TensorShapeProto'Dim
mutable'dim)
                      (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]))))
                      TensorShapeProto -> Parser TensorShapeProto
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
                        (Setter TensorShapeProto TensorShapeProto FieldSet FieldSet
-> (FieldSet -> FieldSet) -> TensorShapeProto -> TensorShapeProto
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 TensorShapeProto TensorShapeProto FieldSet FieldSet
Data.ProtoLens.unknownFields
                           (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t)
                           (Setter
  TensorShapeProto
  TensorShapeProto
  (Vector TensorShapeProto'Dim)
  (Vector TensorShapeProto'Dim)
-> Vector TensorShapeProto'Dim
-> TensorShapeProto
-> TensorShapeProto
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set
                              (forall s a (f :: * -> *).
(HasField s "vec'dim" 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 @"vec'dim") Vector TensorShapeProto'Dim
frozen'dim TensorShapeProto
x))
               else
                   do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                      case Word64
tag of
                        18
                          -> do !TensorShapeProto'Dim
y <- Parser TensorShapeProto'Dim
-> String -> Parser TensorShapeProto'Dim
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                        (do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                            Int -> Parser TensorShapeProto'Dim -> Parser TensorShapeProto'Dim
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'Dim
forall msg. Message msg => Parser msg
Data.ProtoLens.parseMessage)
                                        "dim"
                                Growing Vector RealWorld TensorShapeProto'Dim
v <- IO (Growing Vector RealWorld TensorShapeProto'Dim)
-> Parser (Growing Vector RealWorld TensorShapeProto'Dim)
forall a. IO a -> Parser a
Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO
                                       (Growing Vector (PrimState IO) TensorShapeProto'Dim
-> TensorShapeProto'Dim
-> IO (Growing Vector (PrimState IO) TensorShapeProto'Dim)
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
Growing v (PrimState m) a -> a -> m (Growing v (PrimState m) a)
Data.ProtoLens.Encoding.Growing.append Growing Vector RealWorld TensorShapeProto'Dim
Growing Vector (PrimState IO) TensorShapeProto'Dim
mutable'dim TensorShapeProto'Dim
y)
                                TensorShapeProto
-> Growing Vector RealWorld TensorShapeProto'Dim
-> Parser TensorShapeProto
loop TensorShapeProto
x Growing Vector RealWorld TensorShapeProto'Dim
v
                        24
                          -> do Bool
y <- Parser Bool -> String -> Parser Bool
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       ((Word64 -> Bool) -> Parser Word64 -> Parser Bool
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.fmap
                                          (Word64 -> Word64 -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude./=) 0) Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt)
                                       "unknown_rank"
                                TensorShapeProto
-> Growing Vector RealWorld TensorShapeProto'Dim
-> Parser TensorShapeProto
loop
                                  (Setter TensorShapeProto TensorShapeProto Bool Bool
-> Bool -> TensorShapeProto -> TensorShapeProto
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "unknownRank" 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 @"unknownRank") Bool
y TensorShapeProto
x)
                                  Growing Vector RealWorld TensorShapeProto'Dim
mutable'dim
                        wire :: Word64
wire
                          -> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
                                        Word64
wire
                                TensorShapeProto
-> Growing Vector RealWorld TensorShapeProto'Dim
-> Parser TensorShapeProto
loop
                                  (Setter TensorShapeProto TensorShapeProto FieldSet FieldSet
-> (FieldSet -> FieldSet) -> TensorShapeProto -> TensorShapeProto
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 TensorShapeProto TensorShapeProto FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) TensorShapeProto
x)
                                  Growing Vector RealWorld TensorShapeProto'Dim
mutable'dim
      in
        Parser TensorShapeProto -> String -> Parser TensorShapeProto
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
          (do Growing Vector RealWorld TensorShapeProto'Dim
mutable'dim <- IO (Growing Vector RealWorld TensorShapeProto'Dim)
-> Parser (Growing Vector RealWorld TensorShapeProto'Dim)
forall a. IO a -> Parser a
Data.ProtoLens.Encoding.Parser.Unsafe.unsafeLiftIO
                               IO (Growing Vector RealWorld TensorShapeProto'Dim)
forall (m :: * -> *) (v :: * -> *) a.
(PrimMonad m, Vector v a) =>
m (Growing v (PrimState m) a)
Data.ProtoLens.Encoding.Growing.new
              TensorShapeProto
-> Growing Vector RealWorld TensorShapeProto'Dim
-> Parser TensorShapeProto
loop TensorShapeProto
forall msg. Message msg => msg
Data.ProtoLens.defMessage Growing Vector RealWorld TensorShapeProto'Dim
mutable'dim)
          "TensorShapeProto"
  buildMessage :: TensorShapeProto -> Builder
buildMessage
    = \ _x :: TensorShapeProto
_x
        -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
             ((TensorShapeProto'Dim -> Builder)
-> Vector TensorShapeProto'Dim -> Builder
forall (v :: * -> *) a.
Vector v a =>
(a -> Builder) -> v a -> Builder
Data.ProtoLens.Encoding.Bytes.foldMapBuilder
                (\ _v :: TensorShapeProto'Dim
_v
                   -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                        (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 18)
                        ((ByteString -> Builder)
-> (TensorShapeProto'Dim -> ByteString)
-> TensorShapeProto'Dim
-> 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'Dim -> ByteString
forall msg. Message msg => msg -> ByteString
Data.ProtoLens.encodeMessage
                           TensorShapeProto'Dim
_v))
                (FoldLike
  (Vector TensorShapeProto'Dim)
  TensorShapeProto
  TensorShapeProto
  (Vector TensorShapeProto'Dim)
  (Vector TensorShapeProto'Dim)
-> TensorShapeProto -> Vector TensorShapeProto'Dim
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "vec'dim" 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 @"vec'dim") TensorShapeProto
_x))
             (Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                (let
                   _v :: Bool
_v
                     = FoldLike Bool TensorShapeProto TensorShapeProto Bool Bool
-> TensorShapeProto -> Bool
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "unknownRank" 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 @"unknownRank") TensorShapeProto
_x
                 in
                   if Bool -> Bool -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) Bool
_v Bool
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 24)
                         ((Word64 -> Builder) -> (Bool -> Word64) -> Bool -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
                            Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt
                            (\ b :: Bool
b -> if Bool
b then 1 else 0)
                            Bool
_v))
                (FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
                   (FoldLike
  FieldSet TensorShapeProto TensorShapeProto FieldSet FieldSet
-> TensorShapeProto -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike
  FieldSet TensorShapeProto TensorShapeProto FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields TensorShapeProto
_x)))
instance Control.DeepSeq.NFData TensorShapeProto where
  rnf :: TensorShapeProto -> ()
rnf
    = \ x__ :: TensorShapeProto
x__
        -> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
             (TensorShapeProto -> FieldSet
_TensorShapeProto'_unknownFields TensorShapeProto
x__)
             (Vector TensorShapeProto'Dim -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                (TensorShapeProto -> Vector TensorShapeProto'Dim
_TensorShapeProto'dim TensorShapeProto
x__)
                (Bool -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (TensorShapeProto -> Bool
_TensorShapeProto'unknownRank TensorShapeProto
x__) ()))
{- | Fields :
     
         * 'Proto.Tensorflow.Core.Framework.TensorShape_Fields.size' @:: Lens' TensorShapeProto'Dim Data.Int.Int64@
         * 'Proto.Tensorflow.Core.Framework.TensorShape_Fields.name' @:: Lens' TensorShapeProto'Dim Data.Text.Text@ -}
data TensorShapeProto'Dim
  = TensorShapeProto'Dim'_constructor {TensorShapeProto'Dim -> Int64
_TensorShapeProto'Dim'size :: !Data.Int.Int64,
                                       TensorShapeProto'Dim -> Text
_TensorShapeProto'Dim'name :: !Data.Text.Text,
                                       TensorShapeProto'Dim -> FieldSet
_TensorShapeProto'Dim'_unknownFields :: !Data.ProtoLens.FieldSet}
  deriving stock (TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
(TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool)
-> (TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool)
-> Eq TensorShapeProto'Dim
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
$c/= :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
== :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
$c== :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
Prelude.Eq, Eq TensorShapeProto'Dim
Eq TensorShapeProto'Dim =>
(TensorShapeProto'Dim -> TensorShapeProto'Dim -> Ordering)
-> (TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool)
-> (TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool)
-> (TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool)
-> (TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool)
-> (TensorShapeProto'Dim
    -> TensorShapeProto'Dim -> TensorShapeProto'Dim)
-> (TensorShapeProto'Dim
    -> TensorShapeProto'Dim -> TensorShapeProto'Dim)
-> Ord TensorShapeProto'Dim
TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
TensorShapeProto'Dim -> TensorShapeProto'Dim -> Ordering
TensorShapeProto'Dim
-> TensorShapeProto'Dim -> TensorShapeProto'Dim
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 :: TensorShapeProto'Dim
-> TensorShapeProto'Dim -> TensorShapeProto'Dim
$cmin :: TensorShapeProto'Dim
-> TensorShapeProto'Dim -> TensorShapeProto'Dim
max :: TensorShapeProto'Dim
-> TensorShapeProto'Dim -> TensorShapeProto'Dim
$cmax :: TensorShapeProto'Dim
-> TensorShapeProto'Dim -> TensorShapeProto'Dim
>= :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
$c>= :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
> :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
$c> :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
<= :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
$c<= :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
< :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
$c< :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Bool
compare :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Ordering
$ccompare :: TensorShapeProto'Dim -> TensorShapeProto'Dim -> Ordering
$cp1Ord :: Eq TensorShapeProto'Dim
Prelude.Ord)
instance Prelude.Show TensorShapeProto'Dim where
  showsPrec :: Int -> TensorShapeProto'Dim -> ShowS
showsPrec _ __x :: TensorShapeProto'Dim
__x __s :: String
__s
    = Char -> ShowS
Prelude.showChar
        '{'
        (String -> ShowS
Prelude.showString
           (TensorShapeProto'Dim -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort TensorShapeProto'Dim
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField TensorShapeProto'Dim "size" Data.Int.Int64 where
  fieldOf :: Proxy# "size"
-> (Int64 -> f Int64)
-> TensorShapeProto'Dim
-> f TensorShapeProto'Dim
fieldOf _
    = ((Int64 -> f Int64)
 -> TensorShapeProto'Dim -> f TensorShapeProto'Dim)
-> ((Int64 -> f Int64) -> Int64 -> f Int64)
-> (Int64 -> f Int64)
-> TensorShapeProto'Dim
-> f TensorShapeProto'Dim
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TensorShapeProto'Dim -> Int64)
-> (TensorShapeProto'Dim -> Int64 -> TensorShapeProto'Dim)
-> Lens TensorShapeProto'Dim TensorShapeProto'Dim Int64 Int64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TensorShapeProto'Dim -> Int64
_TensorShapeProto'Dim'size
           (\ x__ :: TensorShapeProto'Dim
x__ y__ :: Int64
y__ -> TensorShapeProto'Dim
x__ {_TensorShapeProto'Dim'size :: Int64
_TensorShapeProto'Dim'size = Int64
y__}))
        (Int64 -> f Int64) -> Int64 -> f Int64
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField TensorShapeProto'Dim "name" Data.Text.Text where
  fieldOf :: Proxy# "name"
-> (Text -> f Text)
-> TensorShapeProto'Dim
-> f TensorShapeProto'Dim
fieldOf _
    = ((Text -> f Text)
 -> TensorShapeProto'Dim -> f TensorShapeProto'Dim)
-> ((Text -> f Text) -> Text -> f Text)
-> (Text -> f Text)
-> TensorShapeProto'Dim
-> f TensorShapeProto'Dim
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((TensorShapeProto'Dim -> Text)
-> (TensorShapeProto'Dim -> Text -> TensorShapeProto'Dim)
-> Lens TensorShapeProto'Dim TensorShapeProto'Dim Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           TensorShapeProto'Dim -> Text
_TensorShapeProto'Dim'name
           (\ x__ :: TensorShapeProto'Dim
x__ y__ :: Text
y__ -> TensorShapeProto'Dim
x__ {_TensorShapeProto'Dim'name :: Text
_TensorShapeProto'Dim'name = Text
y__}))
        (Text -> f Text) -> Text -> f Text
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message TensorShapeProto'Dim where
  messageName :: Proxy TensorShapeProto'Dim -> Text
messageName _ = String -> Text
Data.Text.pack "tensorflow.TensorShapeProto.Dim"
  packedMessageDescriptor :: Proxy TensorShapeProto'Dim -> ByteString
packedMessageDescriptor _
    = "\n\
      \\ETXDim\DC2\DC2\n\
      \\EOTsize\CAN\SOH \SOH(\ETXR\EOTsize\DC2\DC2\n\
      \\EOTname\CAN\STX \SOH(\tR\EOTname"
  packedFileDescriptor :: Proxy TensorShapeProto'Dim -> ByteString
packedFileDescriptor _ = ByteString
packedFileDescriptor
  fieldsByTag :: Map Tag (FieldDescriptor TensorShapeProto'Dim)
fieldsByTag
    = let
        size__field_descriptor :: FieldDescriptor TensorShapeProto'Dim
size__field_descriptor
          = String
-> FieldTypeDescriptor Int64
-> FieldAccessor TensorShapeProto'Dim Int64
-> FieldDescriptor TensorShapeProto'Dim
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "size"
              (ScalarField Int64 -> FieldTypeDescriptor Int64
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField Int64
Data.ProtoLens.Int64Field ::
                 Data.ProtoLens.FieldTypeDescriptor Data.Int.Int64)
              (WireDefault Int64
-> Lens TensorShapeProto'Dim TensorShapeProto'Dim Int64 Int64
-> FieldAccessor TensorShapeProto'Dim Int64
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
                 WireDefault Int64
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "size" 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 @"size")) ::
              Data.ProtoLens.FieldDescriptor TensorShapeProto'Dim
        name__field_descriptor :: FieldDescriptor TensorShapeProto'Dim
name__field_descriptor
          = String
-> FieldTypeDescriptor Text
-> FieldAccessor TensorShapeProto'Dim Text
-> FieldDescriptor TensorShapeProto'Dim
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "name"
              (ScalarField Text -> FieldTypeDescriptor Text
forall value. ScalarField value -> FieldTypeDescriptor value
Data.ProtoLens.ScalarField ScalarField Text
Data.ProtoLens.StringField ::
                 Data.ProtoLens.FieldTypeDescriptor Data.Text.Text)
              (WireDefault Text
-> Lens TensorShapeProto'Dim TensorShapeProto'Dim Text Text
-> FieldAccessor TensorShapeProto'Dim Text
forall value msg.
WireDefault value -> Lens' msg value -> FieldAccessor msg value
Data.ProtoLens.PlainField
                 WireDefault Text
forall value. (FieldDefault value, Eq value) => WireDefault value
Data.ProtoLens.Optional (forall s a (f :: * -> *).
(HasField s "name" 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 @"name")) ::
              Data.ProtoLens.FieldDescriptor TensorShapeProto'Dim
      in
        [(Tag, FieldDescriptor TensorShapeProto'Dim)]
-> Map Tag (FieldDescriptor TensorShapeProto'Dim)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
          [(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor TensorShapeProto'Dim
size__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor TensorShapeProto'Dim
name__field_descriptor)]
  unknownFields :: LensLike' f TensorShapeProto'Dim FieldSet
unknownFields
    = (TensorShapeProto'Dim -> FieldSet)
-> (TensorShapeProto'Dim -> FieldSet -> TensorShapeProto'Dim)
-> Lens' TensorShapeProto'Dim FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
        TensorShapeProto'Dim -> FieldSet
_TensorShapeProto'Dim'_unknownFields
        (\ x__ :: TensorShapeProto'Dim
x__ y__ :: FieldSet
y__ -> TensorShapeProto'Dim
x__ {_TensorShapeProto'Dim'_unknownFields :: FieldSet
_TensorShapeProto'Dim'_unknownFields = FieldSet
y__})
  defMessage :: TensorShapeProto'Dim
defMessage
    = $WTensorShapeProto'Dim'_constructor :: Int64 -> Text -> FieldSet -> TensorShapeProto'Dim
TensorShapeProto'Dim'_constructor
        {_TensorShapeProto'Dim'size :: Int64
_TensorShapeProto'Dim'size = Int64
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _TensorShapeProto'Dim'name :: Text
_TensorShapeProto'Dim'name = Text
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _TensorShapeProto'Dim'_unknownFields :: FieldSet
_TensorShapeProto'Dim'_unknownFields = []}
  parseMessage :: Parser TensorShapeProto'Dim
parseMessage
    = let
        loop ::
          TensorShapeProto'Dim
          -> Data.ProtoLens.Encoding.Bytes.Parser TensorShapeProto'Dim
        loop :: TensorShapeProto'Dim -> Parser TensorShapeProto'Dim
loop x :: TensorShapeProto'Dim
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]))))
                      TensorShapeProto'Dim -> Parser TensorShapeProto'Dim
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
                        (Setter TensorShapeProto'Dim TensorShapeProto'Dim FieldSet FieldSet
-> (FieldSet -> FieldSet)
-> TensorShapeProto'Dim
-> TensorShapeProto'Dim
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 TensorShapeProto'Dim TensorShapeProto'Dim FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) TensorShapeProto'Dim
x)
               else
                   do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                      case Word64
tag of
                        8 -> do Int64
y <- Parser Int64 -> String -> Parser Int64
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       ((Word64 -> Int64) -> Parser Word64 -> Parser Int64
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.fmap
                                          Word64 -> Int64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral
                                          Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt)
                                       "size"
                                TensorShapeProto'Dim -> Parser TensorShapeProto'Dim
loop (Setter TensorShapeProto'Dim TensorShapeProto'Dim Int64 Int64
-> Int64 -> TensorShapeProto'Dim -> TensorShapeProto'Dim
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "size" 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 @"size") Int64
y TensorShapeProto'Dim
x)
                        18
                          -> do Text
y <- Parser Text -> String -> Parser Text
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       (do ByteString
value <- do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                                       Int -> Parser ByteString
Data.ProtoLens.Encoding.Bytes.getBytes
                                                         (Word64 -> Int
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Word64
len)
                                           Either String Text -> Parser Text
forall a. Either String a -> Parser a
Data.ProtoLens.Encoding.Bytes.runEither
                                             (case ByteString -> Either UnicodeException Text
Data.Text.Encoding.decodeUtf8' ByteString
value of
                                                (Prelude.Left err :: UnicodeException
err)
                                                  -> String -> Either String Text
forall a b. a -> Either a b
Prelude.Left (UnicodeException -> String
forall a. Show a => a -> String
Prelude.show UnicodeException
err)
                                                (Prelude.Right r :: Text
r) -> Text -> Either String Text
forall a b. b -> Either a b
Prelude.Right Text
r))
                                       "name"
                                TensorShapeProto'Dim -> Parser TensorShapeProto'Dim
loop (Setter TensorShapeProto'Dim TensorShapeProto'Dim Text Text
-> Text -> TensorShapeProto'Dim -> TensorShapeProto'Dim
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "name" 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 @"name") Text
y TensorShapeProto'Dim
x)
                        wire :: Word64
wire
                          -> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
                                        Word64
wire
                                TensorShapeProto'Dim -> Parser TensorShapeProto'Dim
loop
                                  (Setter TensorShapeProto'Dim TensorShapeProto'Dim FieldSet FieldSet
-> (FieldSet -> FieldSet)
-> TensorShapeProto'Dim
-> TensorShapeProto'Dim
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 TensorShapeProto'Dim TensorShapeProto'Dim FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) TensorShapeProto'Dim
x)
      in
        Parser TensorShapeProto'Dim
-> String -> Parser TensorShapeProto'Dim
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
          (do TensorShapeProto'Dim -> Parser TensorShapeProto'Dim
loop TensorShapeProto'Dim
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "Dim"
  buildMessage :: TensorShapeProto'Dim -> Builder
buildMessage
    = \ _x :: TensorShapeProto'Dim
_x
        -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
             (let _v :: Int64
_v = FoldLike
  Int64 TensorShapeProto'Dim TensorShapeProto'Dim Int64 Int64
-> TensorShapeProto'Dim -> Int64
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "size" 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 @"size") TensorShapeProto'Dim
_x
              in
                if Int64 -> Int64 -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) Int64
_v Int64
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)
                      ((Word64 -> Builder) -> (Int64 -> Word64) -> Int64 -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
                         Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt Int64 -> Word64
forall a b. (Integral a, Num b) => a -> b
Prelude.fromIntegral Int64
_v))
             (Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                (let _v :: Text
_v = FoldLike Text TensorShapeProto'Dim TensorShapeProto'Dim Text Text
-> TensorShapeProto'Dim -> Text
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "name" 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 @"name") TensorShapeProto'Dim
_x
                 in
                   if Text -> Text -> Bool
forall a. Eq a => a -> a -> Bool
(Prelude.==) Text
_v Text
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 18)
                         ((ByteString -> Builder) -> (Text -> ByteString) -> Text -> 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))
                            Text -> ByteString
Data.Text.Encoding.encodeUtf8
                            Text
_v))
                (FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
                   (FoldLike
  FieldSet
  TensorShapeProto'Dim
  TensorShapeProto'Dim
  FieldSet
  FieldSet
-> TensorShapeProto'Dim -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike
  FieldSet
  TensorShapeProto'Dim
  TensorShapeProto'Dim
  FieldSet
  FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields TensorShapeProto'Dim
_x)))
instance Control.DeepSeq.NFData TensorShapeProto'Dim where
  rnf :: TensorShapeProto'Dim -> ()
rnf
    = \ x__ :: TensorShapeProto'Dim
x__
        -> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
             (TensorShapeProto'Dim -> FieldSet
_TensorShapeProto'Dim'_unknownFields TensorShapeProto'Dim
x__)
             (Int64 -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                (TensorShapeProto'Dim -> Int64
_TensorShapeProto'Dim'size TensorShapeProto'Dim
x__)
                (Text -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (TensorShapeProto'Dim -> Text
_TensorShapeProto'Dim'name TensorShapeProto'Dim
x__) ()))
packedFileDescriptor :: Data.ByteString.ByteString
packedFileDescriptor :: ByteString
packedFileDescriptor
  = "\n\
    \,tensorflow/core/framework/tensor_shape.proto\DC2\n\
    \tensorflow\"\152\SOH\n\
    \\DLETensorShapeProto\DC22\n\
    \\ETXdim\CAN\STX \ETX(\v2 .tensorflow.TensorShapeProto.DimR\ETXdim\DC2!\n\
    \\funknown_rank\CAN\ETX \SOH(\bR\vunknownRank\SUB-\n\
    \\ETXDim\DC2\DC2\n\
    \\EOTsize\CAN\SOH \SOH(\ETXR\EOTsize\DC2\DC2\n\
    \\EOTname\CAN\STX \SOH(\tR\EOTnameB\135\SOH\n\
    \\CANorg.tensorflow.frameworkB\DC1TensorShapeProtosP\SOHZSgithub.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto\248\SOH\SOHJ\139\f\n\
    \\ACK\DC2\EOT\STX\NUL-\STX\n\
    \>\n\
    \\SOH\f\DC2\ETX\STX\NUL\DC224 Protocol buffer representing the shape of tensors.\n\
    \\n\
    \\b\n\
    \\SOH\b\DC2\ETX\ETX\NUL\US\n\
    \\t\n\
    \\STX\b\US\DC2\ETX\ETX\NUL\US\n\
    \\b\n\
    \\SOH\b\DC2\ETX\EOT\NUL2\n\
    \\t\n\
    \\STX\b\b\DC2\ETX\EOT\NUL2\n\
    \\b\n\
    \\SOH\b\DC2\ETX\ENQ\NUL\"\n\
    \\t\n\
    \\STX\b\n\
    \\DC2\ETX\ENQ\NUL\"\n\
    \\b\n\
    \\SOH\b\DC2\ETX\ACK\NUL1\n\
    \\t\n\
    \\STX\b\SOH\DC2\ETX\ACK\NUL1\n\
    \\b\n\
    \\SOH\b\DC2\ETX\a\NULj\n\
    \\t\n\
    \\STX\b\v\DC2\ETX\a\NULj\n\
    \\b\n\
    \\SOH\STX\DC2\ETX\t\NUL\DC3\n\
    \%\n\
    \\STX\EOT\NUL\DC2\EOT\f\NUL-\SOH\SUB\EM Dimensions of a tensor.\n\
    \\n\
    \\n\
    \\n\
    \\ETX\EOT\NUL\SOH\DC2\ETX\f\b\CAN\n\
    \,\n\
    \\EOT\EOT\NUL\ETX\NUL\DC2\EOT\SO\STX\CAN\ETX\SUB\RS One dimension of the tensor.\n\
    \\n\
    \\f\n\
    \\ENQ\EOT\NUL\ETX\NUL\SOH\DC2\ETX\SO\n\
    \\r\n\
    \\187\STX\n\
    \\ACK\EOT\NUL\ETX\NUL\STX\NUL\DC2\ETX\DC4\EOT\DC3\SUB\171\STX Size of the tensor in that dimension.\n\
    \ This value must be >= -1, but values of -1 are reserved for \"unknown\"\n\
    \ shapes (values of -1 mean \"unknown\" dimension).  Certain wrappers\n\
    \ that work with TensorShapeProto may fail at runtime when deserializing\n\
    \ a TensorShapeProto containing a dim value of -1.\n\
    \\n\
    \\SO\n\
    \\a\EOT\NUL\ETX\NUL\STX\NUL\ENQ\DC2\ETX\DC4\EOT\t\n\
    \\SO\n\
    \\a\EOT\NUL\ETX\NUL\STX\NUL\SOH\DC2\ETX\DC4\n\
    \\SO\n\
    \\SO\n\
    \\a\EOT\NUL\ETX\NUL\STX\NUL\ETX\DC2\ETX\DC4\DC1\DC2\n\
    \7\n\
    \\ACK\EOT\NUL\ETX\NUL\STX\SOH\DC2\ETX\ETB\EOT\DC4\SUB( Optional name of the tensor dimension.\n\
    \\n\
    \\SO\n\
    \\a\EOT\NUL\ETX\NUL\STX\SOH\ENQ\DC2\ETX\ETB\EOT\n\
    \\n\
    \\SO\n\
    \\a\EOT\NUL\ETX\NUL\STX\SOH\SOH\DC2\ETX\ETB\v\SI\n\
    \\SO\n\
    \\a\EOT\NUL\ETX\NUL\STX\SOH\ETX\DC2\ETX\ETB\DC2\DC3\n\
    \\183\EOT\n\
    \\EOT\EOT\NUL\STX\NUL\DC2\ETX'\STX\ETB\SUB\169\EOT Dimensions of the tensor, such as {\"input\", 30}, {\"output\", 40}\n\
    \ for a 30 x 40 2D tensor.  If an entry has size -1, this\n\
    \ corresponds to a dimension of unknown size. The names are\n\
    \ optional.\n\
    \\n\
    \ The order of entries in \"dim\" matters: It indicates the layout of the\n\
    \ values in the tensor in-memory representation.\n\
    \\n\
    \ The first entry in \"dim\" is the outermost dimension used to layout the\n\
    \ values, the last entry is the innermost dimension.  This matches the\n\
    \ in-memory layout of RowMajor Eigen tensors.\n\
    \\n\
    \ If \"dim.size()\" > 0, \"unknown_rank\" must be false.\n\
    \\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\EOT\DC2\ETX'\STX\n\
    \\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\ACK\DC2\ETX'\v\SO\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\SOH\DC2\ETX'\SI\DC2\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\ETX\DC2\ETX'\NAK\SYN\n\
    \l\n\
    \\EOT\EOT\NUL\STX\SOH\DC2\ETX,\STX\CAN\SUB_ If true, the number of dimensions in the shape is unknown.\n\
    \\n\
    \ If true, \"dim.size()\" must be 0.\n\
    \\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\SOH\ENQ\DC2\ETX,\STX\ACK\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\SOH\SOH\DC2\ETX,\a\DC3\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\SOH\ETX\DC2\ETX,\SYN\ETBb\ACKproto3"