{- This file was auto-generated from tensorflow/core/protobuf/rewriter_config.proto by the proto-lens-protoc program. -}
{-# LANGUAGE ScopedTypeVariables, DataKinds, TypeFamilies,
  UndecidableInstances, MultiParamTypeClasses, FlexibleContexts,
  FlexibleInstances, PatternSynonyms, MagicHash, NoImplicitPrelude
  #-}
{-# OPTIONS_GHC -fno-warn-unused-imports#-}
module Proto.Tensorflow.Core.Protobuf.RewriterConfig where
import qualified Data.ProtoLens.Reexport.Prelude as Prelude
import qualified Data.ProtoLens.Reexport.Data.Int as Data.Int
import qualified Data.ProtoLens.Reexport.Data.Word as Data.Word
import qualified Data.ProtoLens.Reexport.Data.ProtoLens
       as Data.ProtoLens
import qualified
       Data.ProtoLens.Reexport.Data.ProtoLens.Message.Enum
       as Data.ProtoLens.Message.Enum
import qualified Data.ProtoLens.Reexport.Lens.Family2
       as Lens.Family2
import qualified Data.ProtoLens.Reexport.Lens.Family2.Unchecked
       as Lens.Family2.Unchecked
import qualified Data.ProtoLens.Reexport.Data.Default.Class
       as Data.Default.Class
import qualified Data.ProtoLens.Reexport.Data.Text as Data.Text
import qualified Data.ProtoLens.Reexport.Data.Map as Data.Map
import qualified Data.ProtoLens.Reexport.Data.ByteString
       as Data.ByteString
import qualified Data.ProtoLens.Reexport.Lens.Labels as Lens.Labels

data AutoParallelOptions = AutoParallelOptions{_AutoParallelOptions'enable
                                               :: !Prelude.Bool,
                                               _AutoParallelOptions'numReplicas :: !Data.Int.Int32}
                         deriving (Prelude.Show, Prelude.Eq, Prelude.Ord)

instance (a ~ Prelude.Bool, b ~ Prelude.Bool, Prelude.Functor f) =>
         Lens.Labels.HasLens "enable" f AutoParallelOptions
           AutoParallelOptions
           a
           b
         where
        lensOf _
          = (Prelude..)
              (Lens.Family2.Unchecked.lens _AutoParallelOptions'enable
                 (\ x__ y__ -> x__{_AutoParallelOptions'enable = y__}))
              Prelude.id

instance (a ~ Data.Int.Int32, b ~ Data.Int.Int32,
          Prelude.Functor f) =>
         Lens.Labels.HasLens "numReplicas" f AutoParallelOptions
           AutoParallelOptions
           a
           b
         where
        lensOf _
          = (Prelude..)
              (Lens.Family2.Unchecked.lens _AutoParallelOptions'numReplicas
                 (\ x__ y__ -> x__{_AutoParallelOptions'numReplicas = y__}))
              Prelude.id

instance Data.Default.Class.Default AutoParallelOptions where
        def
          = AutoParallelOptions{_AutoParallelOptions'enable =
                                  Data.ProtoLens.fieldDefault,
                                _AutoParallelOptions'numReplicas = Data.ProtoLens.fieldDefault}

instance Data.ProtoLens.Message AutoParallelOptions where
        descriptor
          = let enable__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "enable"
                      (Data.ProtoLens.BoolField ::
                         Data.ProtoLens.FieldTypeDescriptor Prelude.Bool)
                      (Data.ProtoLens.PlainField Data.ProtoLens.Optional enable)
                      :: Data.ProtoLens.FieldDescriptor AutoParallelOptions
                numReplicas__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "num_replicas"
                      (Data.ProtoLens.Int32Field ::
                         Data.ProtoLens.FieldTypeDescriptor Data.Int.Int32)
                      (Data.ProtoLens.PlainField Data.ProtoLens.Optional numReplicas)
                      :: Data.ProtoLens.FieldDescriptor AutoParallelOptions
              in
              Data.ProtoLens.MessageDescriptor
                (Data.Text.pack "tensorflow.AutoParallelOptions")
                (Data.Map.fromList
                   [(Data.ProtoLens.Tag 1, enable__field_descriptor),
                    (Data.ProtoLens.Tag 2, numReplicas__field_descriptor)])
                (Data.Map.fromList
                   [("enable", enable__field_descriptor),
                    ("num_replicas", numReplicas__field_descriptor)])

data RewriterConfig = RewriterConfig{_RewriterConfig'optimizeTensorLayout
                                     :: !Prelude.Bool,
                                     _RewriterConfig'disableModelPruning :: !Prelude.Bool,
                                     _RewriterConfig'constantFolding :: !Prelude.Bool,
                                     _RewriterConfig'memoryOptimization ::
                                     !RewriterConfig'MemOptType,
                                     _RewriterConfig'autoParallel ::
                                     !(Prelude.Maybe AutoParallelOptions),
                                     _RewriterConfig'optimizers :: ![Data.Text.Text]}
                    deriving (Prelude.Show, Prelude.Eq, Prelude.Ord)

instance (a ~ Prelude.Bool, b ~ Prelude.Bool, Prelude.Functor f) =>
         Lens.Labels.HasLens "optimizeTensorLayout" f RewriterConfig
           RewriterConfig
           a
           b
         where
        lensOf _
          = (Prelude..)
              (Lens.Family2.Unchecked.lens _RewriterConfig'optimizeTensorLayout
                 (\ x__ y__ -> x__{_RewriterConfig'optimizeTensorLayout = y__}))
              Prelude.id

instance (a ~ Prelude.Bool, b ~ Prelude.Bool, Prelude.Functor f) =>
         Lens.Labels.HasLens "disableModelPruning" f RewriterConfig
           RewriterConfig
           a
           b
         where
        lensOf _
          = (Prelude..)
              (Lens.Family2.Unchecked.lens _RewriterConfig'disableModelPruning
                 (\ x__ y__ -> x__{_RewriterConfig'disableModelPruning = y__}))
              Prelude.id

instance (a ~ Prelude.Bool, b ~ Prelude.Bool, Prelude.Functor f) =>
         Lens.Labels.HasLens "constantFolding" f RewriterConfig
           RewriterConfig
           a
           b
         where
        lensOf _
          = (Prelude..)
              (Lens.Family2.Unchecked.lens _RewriterConfig'constantFolding
                 (\ x__ y__ -> x__{_RewriterConfig'constantFolding = y__}))
              Prelude.id

instance (a ~ RewriterConfig'MemOptType,
          b ~ RewriterConfig'MemOptType, Prelude.Functor f) =>
         Lens.Labels.HasLens "memoryOptimization" f RewriterConfig
           RewriterConfig
           a
           b
         where
        lensOf _
          = (Prelude..)
              (Lens.Family2.Unchecked.lens _RewriterConfig'memoryOptimization
                 (\ x__ y__ -> x__{_RewriterConfig'memoryOptimization = y__}))
              Prelude.id

instance (a ~ AutoParallelOptions, b ~ AutoParallelOptions,
          Prelude.Functor f) =>
         Lens.Labels.HasLens "autoParallel" f RewriterConfig RewriterConfig
           a
           b
         where
        lensOf _
          = (Prelude..)
              (Lens.Family2.Unchecked.lens _RewriterConfig'autoParallel
                 (\ x__ y__ -> x__{_RewriterConfig'autoParallel = y__}))
              (Data.ProtoLens.maybeLens Data.Default.Class.def)

instance (a ~ Prelude.Maybe AutoParallelOptions,
          b ~ Prelude.Maybe AutoParallelOptions, Prelude.Functor f) =>
         Lens.Labels.HasLens "maybe'autoParallel" f RewriterConfig
           RewriterConfig
           a
           b
         where
        lensOf _
          = (Prelude..)
              (Lens.Family2.Unchecked.lens _RewriterConfig'autoParallel
                 (\ x__ y__ -> x__{_RewriterConfig'autoParallel = y__}))
              Prelude.id

instance (a ~ [Data.Text.Text], b ~ [Data.Text.Text],
          Prelude.Functor f) =>
         Lens.Labels.HasLens "optimizers" f RewriterConfig RewriterConfig a
           b
         where
        lensOf _
          = (Prelude..)
              (Lens.Family2.Unchecked.lens _RewriterConfig'optimizers
                 (\ x__ y__ -> x__{_RewriterConfig'optimizers = y__}))
              Prelude.id

instance Data.Default.Class.Default RewriterConfig where
        def
          = RewriterConfig{_RewriterConfig'optimizeTensorLayout =
                             Data.ProtoLens.fieldDefault,
                           _RewriterConfig'disableModelPruning = Data.ProtoLens.fieldDefault,
                           _RewriterConfig'constantFolding = Data.ProtoLens.fieldDefault,
                           _RewriterConfig'memoryOptimization = Data.Default.Class.def,
                           _RewriterConfig'autoParallel = Prelude.Nothing,
                           _RewriterConfig'optimizers = []}

instance Data.ProtoLens.Message RewriterConfig where
        descriptor
          = let optimizeTensorLayout__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "optimize_tensor_layout"
                      (Data.ProtoLens.BoolField ::
                         Data.ProtoLens.FieldTypeDescriptor Prelude.Bool)
                      (Data.ProtoLens.PlainField Data.ProtoLens.Optional
                         optimizeTensorLayout)
                      :: Data.ProtoLens.FieldDescriptor RewriterConfig
                disableModelPruning__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "disable_model_pruning"
                      (Data.ProtoLens.BoolField ::
                         Data.ProtoLens.FieldTypeDescriptor Prelude.Bool)
                      (Data.ProtoLens.PlainField Data.ProtoLens.Optional
                         disableModelPruning)
                      :: Data.ProtoLens.FieldDescriptor RewriterConfig
                constantFolding__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "constant_folding"
                      (Data.ProtoLens.BoolField ::
                         Data.ProtoLens.FieldTypeDescriptor Prelude.Bool)
                      (Data.ProtoLens.PlainField Data.ProtoLens.Optional constantFolding)
                      :: Data.ProtoLens.FieldDescriptor RewriterConfig
                memoryOptimization__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "memory_optimization"
                      (Data.ProtoLens.EnumField ::
                         Data.ProtoLens.FieldTypeDescriptor RewriterConfig'MemOptType)
                      (Data.ProtoLens.PlainField Data.ProtoLens.Optional
                         memoryOptimization)
                      :: Data.ProtoLens.FieldDescriptor RewriterConfig
                autoParallel__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "auto_parallel"
                      (Data.ProtoLens.MessageField ::
                         Data.ProtoLens.FieldTypeDescriptor AutoParallelOptions)
                      (Data.ProtoLens.OptionalField maybe'autoParallel)
                      :: Data.ProtoLens.FieldDescriptor RewriterConfig
                optimizers__field_descriptor
                  = Data.ProtoLens.FieldDescriptor "optimizers"
                      (Data.ProtoLens.StringField ::
                         Data.ProtoLens.FieldTypeDescriptor Data.Text.Text)
                      (Data.ProtoLens.RepeatedField Data.ProtoLens.Unpacked optimizers)
                      :: Data.ProtoLens.FieldDescriptor RewriterConfig
              in
              Data.ProtoLens.MessageDescriptor
                (Data.Text.pack "tensorflow.RewriterConfig")
                (Data.Map.fromList
                   [(Data.ProtoLens.Tag 1, optimizeTensorLayout__field_descriptor),
                    (Data.ProtoLens.Tag 2, disableModelPruning__field_descriptor),
                    (Data.ProtoLens.Tag 3, constantFolding__field_descriptor),
                    (Data.ProtoLens.Tag 4, memoryOptimization__field_descriptor),
                    (Data.ProtoLens.Tag 5, autoParallel__field_descriptor),
                    (Data.ProtoLens.Tag 100, optimizers__field_descriptor)])
                (Data.Map.fromList
                   [("optimize_tensor_layout",
                     optimizeTensorLayout__field_descriptor),
                    ("disable_model_pruning", disableModelPruning__field_descriptor),
                    ("constant_folding", constantFolding__field_descriptor),
                    ("memory_optimization", memoryOptimization__field_descriptor),
                    ("auto_parallel", autoParallel__field_descriptor),
                    ("optimizers", optimizers__field_descriptor)])

data RewriterConfig'MemOptType = RewriterConfig'NO_MEM_OPT
                               | RewriterConfig'MANUAL
                               | RewriterConfig'HEURISTICS
                               deriving (Prelude.Show, Prelude.Eq, Prelude.Ord)

instance Data.Default.Class.Default RewriterConfig'MemOptType where
        def = RewriterConfig'NO_MEM_OPT

instance Data.ProtoLens.FieldDefault RewriterConfig'MemOptType
         where
        fieldDefault = RewriterConfig'NO_MEM_OPT

instance Data.ProtoLens.MessageEnum RewriterConfig'MemOptType where
        maybeToEnum 0 = Prelude.Just RewriterConfig'NO_MEM_OPT
        maybeToEnum 1 = Prelude.Just RewriterConfig'MANUAL
        maybeToEnum 2 = Prelude.Just RewriterConfig'HEURISTICS
        maybeToEnum _ = Prelude.Nothing
        showEnum RewriterConfig'NO_MEM_OPT = "NO_MEM_OPT"
        showEnum RewriterConfig'MANUAL = "MANUAL"
        showEnum RewriterConfig'HEURISTICS = "HEURISTICS"
        readEnum "NO_MEM_OPT" = Prelude.Just RewriterConfig'NO_MEM_OPT
        readEnum "MANUAL" = Prelude.Just RewriterConfig'MANUAL
        readEnum "HEURISTICS" = Prelude.Just RewriterConfig'HEURISTICS
        readEnum _ = Prelude.Nothing

instance Prelude.Enum RewriterConfig'MemOptType where
        toEnum k__
          = Prelude.maybe
              (Prelude.error
                 ((Prelude.++) "toEnum: unknown value for enum MemOptType: "
                    (Prelude.show k__)))
              Prelude.id
              (Data.ProtoLens.maybeToEnum k__)
        fromEnum RewriterConfig'NO_MEM_OPT = 0
        fromEnum RewriterConfig'MANUAL = 1
        fromEnum RewriterConfig'HEURISTICS = 2
        succ RewriterConfig'HEURISTICS
          = Prelude.error
              "RewriterConfig'MemOptType.succ: bad argument RewriterConfig'HEURISTICS. This value would be out of bounds."
        succ RewriterConfig'NO_MEM_OPT = RewriterConfig'MANUAL
        succ RewriterConfig'MANUAL = RewriterConfig'HEURISTICS
        pred RewriterConfig'NO_MEM_OPT
          = Prelude.error
              "RewriterConfig'MemOptType.pred: bad argument RewriterConfig'NO_MEM_OPT. This value would be out of bounds."
        pred RewriterConfig'MANUAL = RewriterConfig'NO_MEM_OPT
        pred RewriterConfig'HEURISTICS = RewriterConfig'MANUAL
        enumFrom = Data.ProtoLens.Message.Enum.messageEnumFrom
        enumFromTo = Data.ProtoLens.Message.Enum.messageEnumFromTo
        enumFromThen = Data.ProtoLens.Message.Enum.messageEnumFromThen
        enumFromThenTo = Data.ProtoLens.Message.Enum.messageEnumFromThenTo

instance Prelude.Bounded RewriterConfig'MemOptType where
        minBound = RewriterConfig'NO_MEM_OPT
        maxBound = RewriterConfig'HEURISTICS

autoParallel ::
             forall f s t a b .
               (Lens.Labels.HasLens "autoParallel" f s t a b) =>
               Lens.Family2.LensLike f s t a b
autoParallel
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "autoParallel")

constantFolding ::
                forall f s t a b .
                  (Lens.Labels.HasLens "constantFolding" f s t a b) =>
                  Lens.Family2.LensLike f s t a b
constantFolding
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "constantFolding")

disableModelPruning ::
                    forall f s t a b .
                      (Lens.Labels.HasLens "disableModelPruning" f s t a b) =>
                      Lens.Family2.LensLike f s t a b
disableModelPruning
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) ::
         (Lens.Labels.Proxy#) "disableModelPruning")

enable ::
       forall f s t a b . (Lens.Labels.HasLens "enable" f s t a b) =>
         Lens.Family2.LensLike f s t a b
enable
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "enable")

maybe'autoParallel ::
                   forall f s t a b .
                     (Lens.Labels.HasLens "maybe'autoParallel" f s t a b) =>
                     Lens.Family2.LensLike f s t a b
maybe'autoParallel
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "maybe'autoParallel")

memoryOptimization ::
                   forall f s t a b .
                     (Lens.Labels.HasLens "memoryOptimization" f s t a b) =>
                     Lens.Family2.LensLike f s t a b
memoryOptimization
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "memoryOptimization")

numReplicas ::
            forall f s t a b . (Lens.Labels.HasLens "numReplicas" f s t a b) =>
              Lens.Family2.LensLike f s t a b
numReplicas
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "numReplicas")

optimizeTensorLayout ::
                     forall f s t a b .
                       (Lens.Labels.HasLens "optimizeTensorLayout" f s t a b) =>
                       Lens.Family2.LensLike f s t a b
optimizeTensorLayout
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) ::
         (Lens.Labels.Proxy#) "optimizeTensorLayout")

optimizers ::
           forall f s t a b . (Lens.Labels.HasLens "optimizers" f s t a b) =>
             Lens.Family2.LensLike f s t a b
optimizers
  = Lens.Labels.lensOf
      ((Lens.Labels.proxy#) :: (Lens.Labels.Proxy#) "optimizers")