TorchLean API

NN.API.Module.Command

Executable Module Commands #

Command-line support for executable TorchLean programs, including arithmetic and device selection, help output, seed parsing, banners, and exit codes.

Runtime choices parsed from the shared command-line flags.

Instances For

    Parse the shared arithmetic, execution, device, and backend-reporting flags.

    Named devices without an installed runtime remain parseable so diagnostics can report the intended target. Runtime.Config.validateForExecution rejects such a configuration before execution.

    Instances For

      Convert parsed command-line choices to an explicit runtime configuration.

      Instances For

        Print the selected arithmetic, execution strategy, and device.

        Instances For
          def TorchLean.Module.withSelectedRuntime (arguments : List String) (continuation : {α : Type} → [Storage α] → [Context α] → [ToString α] → [Runtime.FromFloat α] → (Floatα)Runtime.ConfigList StringIO Unit) :

          Parse the shared runtime flags, select executable arithmetic, and call continuation with the corresponding literal conversion and explicit runtime options.

          Instances For

            Runtime properties required by an executable command.

            Instances For

              Supply required runtime flags only when the caller did not choose them explicitly.

              Instances For

                Reject a parsed runtime selection that conflicts with the command's requirements.

                Instances For

                  Banner, success-message, and flushing configuration for an executable command.

                  • banner? : Option (Runtime.ConfigString)

                    Optional banner to print before executing the program.

                  • usage? : Option String

                    Command-specific help text; the generic runtime help is used when absent.

                  • flush : Bool

                    Flush stdout after printing the banner, when present.

                  • printSuccess : Bool

                    Print "{exeName}: ok" after successful execution.

                  • Device or execution-mode requirements imposed by this command.

                  Instances For

                    Print the configured executable banner, if one was supplied.

                    Instances For

                      How an executable command chooses its arithmetic semantics.

                      Instances For

                        Generic help text for executables built on TorchLean.Module.Command.run.

                        Instances For
                          def TorchLean.Module.Command.run (exeName : String) (arguments : List String) (action : Action) (config : Config := { }) :

                          Run a TorchLean executable after parsing the shared seed and runtime flags.

                          The selected seed initializes TorchLean's global random stream and is also stored in Runtime.Config, so model initialization and either execution mode observe the same seed.

                          Instances For