{- This file was auto-generated from tensorflow/core/protobuf/named_tensor.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.Protobuf.NamedTensor (
        NamedTensorProto()
    ) 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.Tensor
{- | Fields :
     
         * 'Proto.Tensorflow.Core.Protobuf.NamedTensor_Fields.name' @:: Lens' NamedTensorProto Data.Text.Text@
         * 'Proto.Tensorflow.Core.Protobuf.NamedTensor_Fields.tensor' @:: Lens' NamedTensorProto Proto.Tensorflow.Core.Framework.Tensor.TensorProto@
         * 'Proto.Tensorflow.Core.Protobuf.NamedTensor_Fields.maybe'tensor' @:: Lens' NamedTensorProto (Prelude.Maybe Proto.Tensorflow.Core.Framework.Tensor.TensorProto)@ -}
data NamedTensorProto
  = NamedTensorProto'_constructor {NamedTensorProto -> Text
_NamedTensorProto'name :: !Data.Text.Text,
                                   NamedTensorProto -> Maybe TensorProto
_NamedTensorProto'tensor :: !(Prelude.Maybe Proto.Tensorflow.Core.Framework.Tensor.TensorProto),
                                   NamedTensorProto -> FieldSet
_NamedTensorProto'_unknownFields :: !Data.ProtoLens.FieldSet}
  deriving stock (NamedTensorProto -> NamedTensorProto -> Bool
(NamedTensorProto -> NamedTensorProto -> Bool)
-> (NamedTensorProto -> NamedTensorProto -> Bool)
-> Eq NamedTensorProto
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NamedTensorProto -> NamedTensorProto -> Bool
$c/= :: NamedTensorProto -> NamedTensorProto -> Bool
== :: NamedTensorProto -> NamedTensorProto -> Bool
$c== :: NamedTensorProto -> NamedTensorProto -> Bool
Prelude.Eq, Eq NamedTensorProto
Eq NamedTensorProto =>
(NamedTensorProto -> NamedTensorProto -> Ordering)
-> (NamedTensorProto -> NamedTensorProto -> Bool)
-> (NamedTensorProto -> NamedTensorProto -> Bool)
-> (NamedTensorProto -> NamedTensorProto -> Bool)
-> (NamedTensorProto -> NamedTensorProto -> Bool)
-> (NamedTensorProto -> NamedTensorProto -> NamedTensorProto)
-> (NamedTensorProto -> NamedTensorProto -> NamedTensorProto)
-> Ord NamedTensorProto
NamedTensorProto -> NamedTensorProto -> Bool
NamedTensorProto -> NamedTensorProto -> Ordering
NamedTensorProto -> NamedTensorProto -> NamedTensorProto
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 :: NamedTensorProto -> NamedTensorProto -> NamedTensorProto
$cmin :: NamedTensorProto -> NamedTensorProto -> NamedTensorProto
max :: NamedTensorProto -> NamedTensorProto -> NamedTensorProto
$cmax :: NamedTensorProto -> NamedTensorProto -> NamedTensorProto
>= :: NamedTensorProto -> NamedTensorProto -> Bool
$c>= :: NamedTensorProto -> NamedTensorProto -> Bool
> :: NamedTensorProto -> NamedTensorProto -> Bool
$c> :: NamedTensorProto -> NamedTensorProto -> Bool
<= :: NamedTensorProto -> NamedTensorProto -> Bool
$c<= :: NamedTensorProto -> NamedTensorProto -> Bool
< :: NamedTensorProto -> NamedTensorProto -> Bool
$c< :: NamedTensorProto -> NamedTensorProto -> Bool
compare :: NamedTensorProto -> NamedTensorProto -> Ordering
$ccompare :: NamedTensorProto -> NamedTensorProto -> Ordering
$cp1Ord :: Eq NamedTensorProto
Prelude.Ord)
instance Prelude.Show NamedTensorProto where
  showsPrec :: Int -> NamedTensorProto -> ShowS
showsPrec _ __x :: NamedTensorProto
__x __s :: String
__s
    = Char -> ShowS
Prelude.showChar
        '{'
        (String -> ShowS
Prelude.showString
           (NamedTensorProto -> String
forall msg. Message msg => msg -> String
Data.ProtoLens.showMessageShort NamedTensorProto
__x) (Char -> ShowS
Prelude.showChar '}' String
__s))
instance Data.ProtoLens.Field.HasField NamedTensorProto "name" Data.Text.Text where
  fieldOf :: Proxy# "name"
-> (Text -> f Text) -> NamedTensorProto -> f NamedTensorProto
fieldOf _
    = ((Text -> f Text) -> NamedTensorProto -> f NamedTensorProto)
-> ((Text -> f Text) -> Text -> f Text)
-> (Text -> f Text)
-> NamedTensorProto
-> f NamedTensorProto
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((NamedTensorProto -> Text)
-> (NamedTensorProto -> Text -> NamedTensorProto)
-> Lens NamedTensorProto NamedTensorProto Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           NamedTensorProto -> Text
_NamedTensorProto'name
           (\ x__ :: NamedTensorProto
x__ y__ :: Text
y__ -> NamedTensorProto
x__ {_NamedTensorProto'name :: Text
_NamedTensorProto'name = Text
y__}))
        (Text -> f Text) -> Text -> f Text
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Field.HasField NamedTensorProto "tensor" Proto.Tensorflow.Core.Framework.Tensor.TensorProto where
  fieldOf :: Proxy# "tensor"
-> (TensorProto -> f TensorProto)
-> NamedTensorProto
-> f NamedTensorProto
fieldOf _
    = ((Maybe TensorProto -> f (Maybe TensorProto))
 -> NamedTensorProto -> f NamedTensorProto)
-> ((TensorProto -> f TensorProto)
    -> Maybe TensorProto -> f (Maybe TensorProto))
-> (TensorProto -> f TensorProto)
-> NamedTensorProto
-> f NamedTensorProto
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((NamedTensorProto -> Maybe TensorProto)
-> (NamedTensorProto -> Maybe TensorProto -> NamedTensorProto)
-> Lens
     NamedTensorProto
     NamedTensorProto
     (Maybe TensorProto)
     (Maybe TensorProto)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           NamedTensorProto -> Maybe TensorProto
_NamedTensorProto'tensor
           (\ x__ :: NamedTensorProto
x__ y__ :: Maybe TensorProto
y__ -> NamedTensorProto
x__ {_NamedTensorProto'tensor :: Maybe TensorProto
_NamedTensorProto'tensor = Maybe TensorProto
y__}))
        (TensorProto -> Lens' (Maybe TensorProto) TensorProto
forall b. b -> Lens' (Maybe b) b
Data.ProtoLens.maybeLens TensorProto
forall msg. Message msg => msg
Data.ProtoLens.defMessage)
instance Data.ProtoLens.Field.HasField NamedTensorProto "maybe'tensor" (Prelude.Maybe Proto.Tensorflow.Core.Framework.Tensor.TensorProto) where
  fieldOf :: Proxy# "maybe'tensor"
-> (Maybe TensorProto -> f (Maybe TensorProto))
-> NamedTensorProto
-> f NamedTensorProto
fieldOf _
    = ((Maybe TensorProto -> f (Maybe TensorProto))
 -> NamedTensorProto -> f NamedTensorProto)
-> ((Maybe TensorProto -> f (Maybe TensorProto))
    -> Maybe TensorProto -> f (Maybe TensorProto))
-> (Maybe TensorProto -> f (Maybe TensorProto))
-> NamedTensorProto
-> f NamedTensorProto
forall b c a. (b -> c) -> (a -> b) -> a -> c
(Prelude..)
        ((NamedTensorProto -> Maybe TensorProto)
-> (NamedTensorProto -> Maybe TensorProto -> NamedTensorProto)
-> Lens
     NamedTensorProto
     NamedTensorProto
     (Maybe TensorProto)
     (Maybe TensorProto)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
           NamedTensorProto -> Maybe TensorProto
_NamedTensorProto'tensor
           (\ x__ :: NamedTensorProto
x__ y__ :: Maybe TensorProto
y__ -> NamedTensorProto
x__ {_NamedTensorProto'tensor :: Maybe TensorProto
_NamedTensorProto'tensor = Maybe TensorProto
y__}))
        (Maybe TensorProto -> f (Maybe TensorProto))
-> Maybe TensorProto -> f (Maybe TensorProto)
forall a. a -> a
Prelude.id
instance Data.ProtoLens.Message NamedTensorProto where
  messageName :: Proxy NamedTensorProto -> Text
messageName _ = String -> Text
Data.Text.pack "tensorflow.NamedTensorProto"
  packedMessageDescriptor :: Proxy NamedTensorProto -> ByteString
packedMessageDescriptor _
    = "\n\
      \\DLENamedTensorProto\DC2\DC2\n\
      \\EOTname\CAN\SOH \SOH(\tR\EOTname\DC2/\n\
      \\ACKtensor\CAN\STX \SOH(\v2\ETB.tensorflow.TensorProtoR\ACKtensor"
  packedFileDescriptor :: Proxy NamedTensorProto -> ByteString
packedFileDescriptor _ = ByteString
packedFileDescriptor
  fieldsByTag :: Map Tag (FieldDescriptor NamedTensorProto)
fieldsByTag
    = let
        name__field_descriptor :: FieldDescriptor NamedTensorProto
name__field_descriptor
          = String
-> FieldTypeDescriptor Text
-> FieldAccessor NamedTensorProto Text
-> FieldDescriptor NamedTensorProto
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 NamedTensorProto NamedTensorProto Text Text
-> FieldAccessor NamedTensorProto 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 NamedTensorProto
        tensor__field_descriptor :: FieldDescriptor NamedTensorProto
tensor__field_descriptor
          = String
-> FieldTypeDescriptor TensorProto
-> FieldAccessor NamedTensorProto TensorProto
-> FieldDescriptor NamedTensorProto
forall value msg.
String
-> FieldTypeDescriptor value
-> FieldAccessor msg value
-> FieldDescriptor msg
Data.ProtoLens.FieldDescriptor
              "tensor"
              (MessageOrGroup -> FieldTypeDescriptor TensorProto
forall value.
Message value =>
MessageOrGroup -> FieldTypeDescriptor value
Data.ProtoLens.MessageField MessageOrGroup
Data.ProtoLens.MessageType ::
                 Data.ProtoLens.FieldTypeDescriptor Proto.Tensorflow.Core.Framework.Tensor.TensorProto)
              (Lens
  NamedTensorProto
  NamedTensorProto
  (Maybe TensorProto)
  (Maybe TensorProto)
-> FieldAccessor NamedTensorProto TensorProto
forall msg value.
Lens' msg (Maybe value) -> FieldAccessor msg value
Data.ProtoLens.OptionalField
                 (forall s a (f :: * -> *).
(HasField s "maybe'tensor" 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'tensor")) ::
              Data.ProtoLens.FieldDescriptor NamedTensorProto
      in
        [(Tag, FieldDescriptor NamedTensorProto)]
-> Map Tag (FieldDescriptor NamedTensorProto)
forall k a. Ord k => [(k, a)] -> Map k a
Data.Map.fromList
          [(Int -> Tag
Data.ProtoLens.Tag 1, FieldDescriptor NamedTensorProto
name__field_descriptor),
           (Int -> Tag
Data.ProtoLens.Tag 2, FieldDescriptor NamedTensorProto
tensor__field_descriptor)]
  unknownFields :: LensLike' f NamedTensorProto FieldSet
unknownFields
    = (NamedTensorProto -> FieldSet)
-> (NamedTensorProto -> FieldSet -> NamedTensorProto)
-> Lens' NamedTensorProto FieldSet
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.Family2.Unchecked.lens
        NamedTensorProto -> FieldSet
_NamedTensorProto'_unknownFields
        (\ x__ :: NamedTensorProto
x__ y__ :: FieldSet
y__ -> NamedTensorProto
x__ {_NamedTensorProto'_unknownFields :: FieldSet
_NamedTensorProto'_unknownFields = FieldSet
y__})
  defMessage :: NamedTensorProto
defMessage
    = $WNamedTensorProto'_constructor :: Text -> Maybe TensorProto -> FieldSet -> NamedTensorProto
NamedTensorProto'_constructor
        {_NamedTensorProto'name :: Text
_NamedTensorProto'name = Text
forall value. FieldDefault value => value
Data.ProtoLens.fieldDefault,
         _NamedTensorProto'tensor :: Maybe TensorProto
_NamedTensorProto'tensor = Maybe TensorProto
forall a. Maybe a
Prelude.Nothing,
         _NamedTensorProto'_unknownFields :: FieldSet
_NamedTensorProto'_unknownFields = []}
  parseMessage :: Parser NamedTensorProto
parseMessage
    = let
        loop ::
          NamedTensorProto
          -> Data.ProtoLens.Encoding.Bytes.Parser NamedTensorProto
        loop :: NamedTensorProto -> Parser NamedTensorProto
loop x :: NamedTensorProto
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]))))
                      NamedTensorProto -> Parser NamedTensorProto
forall (m :: * -> *) a. Monad m => a -> m a
Prelude.return
                        (Setter NamedTensorProto NamedTensorProto FieldSet FieldSet
-> (FieldSet -> FieldSet) -> NamedTensorProto -> NamedTensorProto
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 NamedTensorProto NamedTensorProto FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> FieldSet -> FieldSet
forall a. [a] -> [a]
Prelude.reverse FieldSet
t) NamedTensorProto
x)
               else
                   do Word64
tag <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                      case Word64
tag of
                        10
                          -> 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"
                                NamedTensorProto -> Parser NamedTensorProto
loop (Setter NamedTensorProto NamedTensorProto Text Text
-> Text -> NamedTensorProto -> NamedTensorProto
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 NamedTensorProto
x)
                        18
                          -> do TensorProto
y <- Parser TensorProto -> String -> Parser TensorProto
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
                                       (do Word64
len <- Parser Word64
Data.ProtoLens.Encoding.Bytes.getVarInt
                                           Int -> Parser TensorProto -> Parser TensorProto
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 TensorProto
forall msg. Message msg => Parser msg
Data.ProtoLens.parseMessage)
                                       "tensor"
                                NamedTensorProto -> Parser NamedTensorProto
loop (Setter NamedTensorProto NamedTensorProto TensorProto TensorProto
-> TensorProto -> NamedTensorProto -> NamedTensorProto
forall s t a b. Setter s t a b -> b -> s -> t
Lens.Family2.set (forall s a (f :: * -> *).
(HasField s "tensor" 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 @"tensor") TensorProto
y NamedTensorProto
x)
                        wire :: Word64
wire
                          -> do !TaggedValue
y <- Word64 -> Parser TaggedValue
Data.ProtoLens.Encoding.Wire.parseTaggedValueFromWire
                                        Word64
wire
                                NamedTensorProto -> Parser NamedTensorProto
loop
                                  (Setter NamedTensorProto NamedTensorProto FieldSet FieldSet
-> (FieldSet -> FieldSet) -> NamedTensorProto -> NamedTensorProto
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 NamedTensorProto NamedTensorProto FieldSet FieldSet
Data.ProtoLens.unknownFields (\ !FieldSet
t -> (:) TaggedValue
y FieldSet
t) NamedTensorProto
x)
      in
        Parser NamedTensorProto -> String -> Parser NamedTensorProto
forall a. Parser a -> String -> Parser a
(Data.ProtoLens.Encoding.Bytes.<?>)
          (do NamedTensorProto -> Parser NamedTensorProto
loop NamedTensorProto
forall msg. Message msg => msg
Data.ProtoLens.defMessage) "NamedTensorProto"
  buildMessage :: NamedTensorProto -> Builder
buildMessage
    = \ _x :: NamedTensorProto
_x
        -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
             (let _v :: Text
_v = FoldLike Text NamedTensorProto NamedTensorProto Text Text
-> NamedTensorProto -> 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") NamedTensorProto
_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 10)
                      ((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))
             (Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                (case
                     FoldLike
  (Maybe TensorProto)
  NamedTensorProto
  NamedTensorProto
  (Maybe TensorProto)
  (Maybe TensorProto)
-> NamedTensorProto -> Maybe TensorProto
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view (forall s a (f :: * -> *).
(HasField s "maybe'tensor" 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'tensor") NamedTensorProto
_x
                 of
                   Prelude.Nothing -> Builder
forall a. Monoid a => a
Data.Monoid.mempty
                   (Prelude.Just _v :: TensorProto
_v)
                     -> Builder -> Builder -> Builder
forall a. Semigroup a => a -> a -> a
(Data.Monoid.<>)
                          (Word64 -> Builder
Data.ProtoLens.Encoding.Bytes.putVarInt 18)
                          ((ByteString -> Builder)
-> (TensorProto -> ByteString) -> TensorProto -> 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))
                             TensorProto -> ByteString
forall msg. Message msg => msg -> ByteString
Data.ProtoLens.encodeMessage
                             TensorProto
_v))
                (FieldSet -> Builder
Data.ProtoLens.Encoding.Wire.buildFieldSet
                   (FoldLike
  FieldSet NamedTensorProto NamedTensorProto FieldSet FieldSet
-> NamedTensorProto -> FieldSet
forall a s t b. FoldLike a s t a b -> s -> a
Lens.Family2.view FoldLike
  FieldSet NamedTensorProto NamedTensorProto FieldSet FieldSet
forall msg. Message msg => Lens' msg FieldSet
Data.ProtoLens.unknownFields NamedTensorProto
_x)))
instance Control.DeepSeq.NFData NamedTensorProto where
  rnf :: NamedTensorProto -> ()
rnf
    = \ x__ :: NamedTensorProto
x__
        -> FieldSet -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
             (NamedTensorProto -> FieldSet
_NamedTensorProto'_unknownFields NamedTensorProto
x__)
             (Text -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq
                (NamedTensorProto -> Text
_NamedTensorProto'name NamedTensorProto
x__)
                (Maybe TensorProto -> () -> ()
forall a b. NFData a => a -> b -> b
Control.DeepSeq.deepseq (NamedTensorProto -> Maybe TensorProto
_NamedTensorProto'tensor NamedTensorProto
x__) ()))
packedFileDescriptor :: Data.ByteString.ByteString
packedFileDescriptor :: ByteString
packedFileDescriptor
  = "\n\
    \+tensorflow/core/protobuf/named_tensor.proto\DC2\n\
    \tensorflow\SUB&tensorflow/core/framework/tensor.proto\"W\n\
    \\DLENamedTensorProto\DC2\DC2\n\
    \\EOTname\CAN\SOH \SOH(\tR\EOTname\DC2/\n\
    \\ACKtensor\CAN\STX \SOH(\v2\ETB.tensorflow.TensorProtoR\ACKtensorB|\n\
    \\CANorg.tensorflow.frameworkB\DC1NamedTensorProtosP\SOHZHgithub.com/tensorflow/tensorflow/tensorflow/go/core/core_protos_go_proto\248\SOH\SOHJ\255\EOT\n\
    \\ACK\DC2\EOT\NUL\NUL\CAN\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\NUL0\n\
    \\b\n\
    \\SOH\b\DC2\ETX\ACK\NUL\US\n\
    \\t\n\
    \\STX\b\US\DC2\ETX\ACK\NUL\US\n\
    \\b\n\
    \\SOH\b\DC2\ETX\a\NUL2\n\
    \\t\n\
    \\STX\b\b\DC2\ETX\a\NUL2\n\
    \\b\n\
    \\SOH\b\DC2\ETX\b\NUL\"\n\
    \\t\n\
    \\STX\b\n\
    \\DC2\ETX\b\NUL\"\n\
    \\b\n\
    \\SOH\b\DC2\ETX\t\NUL1\n\
    \\t\n\
    \\STX\b\SOH\DC2\ETX\t\NUL1\n\
    \\b\n\
    \\SOH\b\DC2\ETX\n\
    \\NUL_\n\
    \\t\n\
    \\STX\b\v\DC2\ETX\n\
    \\NUL_\n\
    \6\n\
    \\STX\EOT\NUL\DC2\EOT\r\NUL\CAN\SOH\SUB* A pair of tensor name and tensor values.\n\
    \\n\
    \\n\
    \\n\
    \\ETX\EOT\NUL\SOH\DC2\ETX\r\b\CAN\n\
    \\"\n\
    \\EOT\EOT\NUL\STX\NUL\DC2\ETX\SI\STX\DC2\SUB\NAK Name of the tensor.\n\
    \\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\ENQ\DC2\ETX\SI\STX\b\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\SOH\DC2\ETX\SI\t\r\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\NUL\ETX\DC2\ETX\SI\DLE\DC1\n\
    \\176\STX\n\
    \\EOT\EOT\NUL\STX\SOH\DC2\ETX\ETB\STX\EM\SUB\162\STX The client can populate a TensorProto using a tensorflow::Tensor`, or\n\
    \ directly using the protobuf field accessors.\n\
    \\n\
    \ The client specifies whether the returned tensor values should be\n\
    \ filled tensor fields (float_val, int_val, etc.) or encoded in a\n\
    \ compact form in tensor.tensor_content.\n\
    \\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\SOH\ACK\DC2\ETX\ETB\STX\r\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\SOH\SOH\DC2\ETX\ETB\SO\DC4\n\
    \\f\n\
    \\ENQ\EOT\NUL\STX\SOH\ETX\DC2\ETX\ETB\ETB\CANb\ACKproto3"