TorchLean API

NN.API.Public.Facade.Base.CLI

TorchLean CLI Facade #

Small command-line parsers used by examples and model-zoo commands.

Small public command-line parsers for examples.

Use these when a runnable example needs the same compact flag convention as the model zoo.

@[reducible, inline]

Drop Lake's -- separator when present.

Instances For
    @[reducible, inline]

    Return true when the argument list requests command help.

    Instances For
      def TorchLean.CLI.seed (exeName : String) (args : List String) (default : := 0) :

      Parse --seed N, returning the selected seed and remaining arguments.

      Instances For
        def TorchLean.CLI.natFlag? (exeName : String) (args : List String) (name : String) :

        Parse an optional natural-number flag such as --steps 200.

        Instances For
          def TorchLean.CLI.natFlagDefault (exeName : String) (args : List String) (name : String) (default : ) :

          Parse an optional natural-number flag and fall back to a default.

          Instances For
            def TorchLean.CLI.positiveNatFlag (exeName : String) (args : List String) (name : String) (default : ) :

            Parse an optional natural-number flag, fall back to a default, and require that the selected value is strictly positive.

            Instances For

              Parse an optional path flag such as --csv data.csv.

              Instances For
                def TorchLean.CLI.floatFlagDefault (exeName : String) (args : List String) (name : String) (default : Float) :

                Parse an optional float flag and fall back to a default.

                Instances For

                  Parse an optional path flag and fall back to a default path.

                  Instances For
                    def TorchLean.CLI.epochBatch (exeName : String) (args : List String) (defaultEpochs defaultBatch : ) :

                    Parse the --epochs E --batch N pair used by the small epoch-oriented tutorial commands.

                    Step-based model-zoo training commands use the ModelZoo / Trainer.TrainOptions path instead.

                    Instances For
                      @[reducible, inline]
                      abbrev TorchLean.CLI.takeEpochBatch (args : List String) (defaultEpochs defaultBatch : ) :

                      Parser used by model-zoo commands that build an Except parser first.

                      Instances For
                        @[reducible, inline]
                        abbrev TorchLean.CLI.takePositiveEpochBatch (args : List String) (exeName : String) (defaultEpochs defaultBatch : ) :

                        Parser used by epoch-oriented tutorial commands that require positive --epochs and --batch.

                        Instances For
                          def TorchLean.CLI.orThrow {α : Type} (exeName : String) (result : Except String α) :
                          IO α

                          Convert an Except String α into IO α with a shared executable name.

                          Instances For

                            Require that no example-specific arguments remain after parsing.

                            Instances For
                              def TorchLean.CLI.takeSeed (args : List String) (default : := 0) :

                              Parser used by model-zoo commands that build an Except parser first.

                              Instances For
                                @[reducible, inline]

                                Parser used by model-zoo commands that build an Except parser first.

                                Instances For
                                  @[reducible, inline]

                                  Parser used by model-zoo commands that want a natural-number flag with a default.

                                  Instances For
                                    @[reducible, inline]

                                    Parser used by model-zoo commands that want a positive natural-number flag.

                                    Instances For
                                      @[reducible, inline]

                                      Low-level parser used by model-zoo commands that build an Except parser first.

                                      Instances For
                                        @[reducible, inline]

                                        Low-level parser used by model-zoo commands that want a float flag with a default.

                                        Instances For
                                          @[reducible, inline]

                                          Low-level parser used by model-zoo commands that require a positive float flag.

                                          Instances For
                                            @[reducible, inline]

                                            Low-level parser used by model-zoo commands that require a nonnegative float flag.

                                            Instances For
                                              @[reducible, inline]

                                              Low-level parser used by model-zoo commands that build an Except parser first.

                                              Instances For
                                                @[reducible, inline]

                                                Low-level parser used by model-zoo commands that want a concrete string-valued flag.

                                                Instances For
                                                  def TorchLean.CLI.takeParsedFlagDefault {α : Type} (args : List String) (key default : String) (parse : StringExcept String α) :

                                                  Low-level parser used by model-zoo commands whose string flag is decoded by a custom parser.

                                                  Instances For
                                                    @[reducible, inline]

                                                    Low-level parser used by model-zoo commands that build an Except parser first.

                                                    Instances For
                                                      @[reducible, inline]

                                                      Low-level parser used by model-zoo commands that want a concrete path with a default.

                                                      Instances For

                                                        Low-level parser used by model-zoo commands that require a path flag to be present.

                                                        Instances For
                                                          @[reducible, inline]

                                                          Low-level parser used by model-zoo commands whose two path flags must appear together.

                                                          Instances For
                                                            @[reducible, inline]

                                                            Low-level parser used by model-zoo commands that build an Except parser first.

                                                            Instances For
                                                              @[reducible, inline]

                                                              Low-level no-extra-arguments check for parsers that stay in Except.

                                                              Instances For
                                                                @[reducible, inline]

                                                                Check whether a flag appears with an attached value such as --log out.json.

                                                                Instances For
                                                                  @[reducible, inline]
                                                                  Instances For