LLVM  14.0.0git
Functions
generate_mock_model Namespace Reference

Functions

def get_output_spec_path (path)
 
def build_mock_model (path, signature)
 
def get_external_signature (config_path)
 
def main (argv)
 

Detailed Description

Generate a mock model for LLVM tests.

The generated model is not a neural net - it is just a tf.function with the
correct input and output parameters. By construction, the mock model will always
output 1.

Function Documentation

◆ build_mock_model()

def generate_mock_model.build_mock_model (   path,
  signature 
)
Build and save the mock model with the given signature

Definition at line 19 of file generate_mock_model.py.

References get_output_spec_path(), and print().

Referenced by main().

◆ get_external_signature()

def generate_mock_model.get_external_signature (   config_path)
Get the signature for the desired model.

We manually import the python file at config_path to avoid adding a gin
dependency to the LLVM build.

Definition at line 41 of file generate_mock_model.py.

References config.get_input_signature(), config.get_output_signature(), and config.get_output_spec().

Referenced by main().

◆ get_output_spec_path()

def generate_mock_model.get_output_spec_path (   path)

Definition at line 15 of file generate_mock_model.py.

Referenced by build_mock_model().

◆ main()

def generate_mock_model.main (   argv)

Definition at line 58 of file generate_mock_model.py.

References build_mock_model(), get_external_signature(), and print().