TorchLean API

NN.Examples.Models.Runner

TorchLean Example Runner #

Executable root for the torchlean example runner.

Each example keeps its own namespace, and this module selects which one to run from a subcommand argument such as mlp or gpt2.

Runtime flags that consume the following command-line token.

Instances For

    Split CLI arguments into (prefixFlags, command, commandArgs).

    We allow "global" runtime flags before the command name so users can write either:

    • torchlean mlp --device cpu, or
    • torchlean --device cpu mlp.
    Instances For

      Detect whether the command line already selects a runtime device.

      Instances For

        Read one line, treating EOF as the default answer.

        Instances For

          Ask for the device in the interactive runtime chooser.

          Fill in missing runtime choices interactively.

          The chooser is explicit (--choose) so scripts, tests, and CI never block waiting for stdin.

          Instances For

            Strip top-level runner flags that are not meant for individual examples.

            Instances For