Improve help documentation for split flags.
Make it easier to locally find out how to pass flags to the different backends. PiperOrigin-RevId: 357281536 Change-Id: I4fbdf200f8f65f5aec1588f5d7285dc8622549cd
This commit is contained in:
parent
156b5ce928
commit
be0ec80ce4
@ -17,6 +17,17 @@ limitations under the License.
|
|||||||
|
|
||||||
#include "tensorflow/core/platform/init_main.h"
|
#include "tensorflow/core/platform/init_main.h"
|
||||||
|
|
||||||
|
static llvm::cl::extrahelp FlagSplittingHelp(R"(
|
||||||
|
The command line parsing is split between the two flag parsing libraries used by
|
||||||
|
TensorFlow and LLVM:
|
||||||
|
* Flags before the first '--' are parsed by tensorflow::InitMain while those
|
||||||
|
post are parsed by LLVM's command line parser.
|
||||||
|
* If there is no separator, then no flags are parsed by InitMain and only
|
||||||
|
LLVM command line parser used.
|
||||||
|
The above help options reported are for LLVM's parser, run with `--help --` for
|
||||||
|
TensorFlow's help.
|
||||||
|
)");
|
||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
|
|
||||||
InitMlir::InitMlir(int *argc, char ***argv) : init_llvm_(*argc, *argv) {
|
InitMlir::InitMlir(int *argc, char ***argv) : init_llvm_(*argc, *argv) {
|
||||||
|
@ -21,12 +21,11 @@ limitations under the License.
|
|||||||
|
|
||||||
namespace tensorflow {
|
namespace tensorflow {
|
||||||
|
|
||||||
// Initializer to perform both InitLLVM and TF"s InitMain initialization.
|
// Initializer to perform both InitLLVM and TF's InitMain initialization.
|
||||||
// InitMain also performs flag parsing and '--' is used to separate flags passed
|
// InitMain also performs flag parsing and '--' is used to separate flags passed
|
||||||
// to it: Flags before the first '--' are parsed by InitMain and argc and argv
|
// to it: Flags before the first '--' are parsed by InitMain and argc and argv
|
||||||
// progressed to the flags post. If there is no separator, then no flags are
|
// progressed to the flags post. If there is no separator, then no flags are
|
||||||
// parsed by InitMain and argc/argv left unadjusted.
|
// parsed by InitMain and argc/argv left unadjusted.
|
||||||
// TODO(jpienaar): The way help flag is handled could be improved.
|
|
||||||
class InitMlir {
|
class InitMlir {
|
||||||
public:
|
public:
|
||||||
InitMlir(int *argc, char ***argv);
|
InitMlir(int *argc, char ***argv);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user