experimental_experiment.ext_test_case

The module contains the main class ExtTestCase which adds specific functionalities to this project.

class experimental_experiment.ext_test_case.ExtTestCase(methodName='runTest')[source]

Inherits from unittest.TestCase and adds specific comprison functions and other helpers.

assertAlmostEqual(expected: ndarray, value: ndarray, atol: float = 0, rtol: float = 0)[source]

In the name

assertEmpty(value: Any)[source]

In the name

assertEqual(expected: Any, value: Any, msg: str = '')[source]

Overwrites the error message to get a more explicit message about what is what.

assertEqualArray(expected: ndarray, value: ndarray, atol: float = 0, rtol: float = 0, msg: str | None = None)[source]

In the name

assertEqualArrays(expected: Sequence[ndarray], value: Sequence[ndarray], atol: float = 0, rtol: float = 0, msg: str | None = None)[source]

In the name

assertExists(name)[source]

Checks the existing of a file.

assertGreaterOrEqual(a, b, msg=None)[source]

In the name

assertIn(tofind: str, text: str, msg: str = '')[source]

Just like self.assertTrue(a in b), but with a nicer default message.

assertNotEmpty(value: Any)[source]

In the name

assertRaise(fct: Callable, exc_type: type[Exception], msg: str | None = None)[source]

In the name

assertStartsWith(prefix: str, full: str)[source]

In the name

capture(fct: Callable)[source]

Runs a function and capture standard output and error.

Parameters:

fct – function to run

Returns:

result of fct, output, error

dump_onnx(name: str, proto: Any, folder: str | None = None) str[source]

Dumps an onnx file.

get_dump_file(name: str, folder: str | None = None) str[source]

Returns a filename to dump a model.

print_model(model: ModelProto)[source]

Prints a ModelProto

print_onnx(model: ModelProto)[source]

Prints a ModelProto

classmethod setUpClass()[source]

Hook method for setting up class fixture before running tests in the class.

classmethod tearDownClass()[source]

Hook method for deconstructing the class fixture after running all tests in the class.

tryCall(fct: Callable, msg: str | None = None, none_if: str | None = None) Any | None[source]

Calls the function, catch any error.

Parameters:
  • fct – function to call

  • msg – error message to display if failing

  • none_if – returns None if this substring is found in the error message

Returns:

output of fct

experimental_experiment.ext_test_case.dump_dort_onnx(fn)[source]

Context manager to dump onnx model created by dort.

experimental_experiment.ext_test_case.get_figure(ax)[source]

Returns the figure of a matplotlib figure.

experimental_experiment.ext_test_case.has_cuda() bool[source]

Returns torch.cuda.is_available().

experimental_experiment.ext_test_case.has_executorch(version: str = '', msg: str = '') Callable[source]

Tells if ExecuTorch is installed.

experimental_experiment.ext_test_case.has_onnxruntime_training(push_back_batch: bool = False)[source]

Tells if onnxruntime_training is installed.

experimental_experiment.ext_test_case.has_torch(version: str) bool[source]

Returns True if torch verions is higher.

experimental_experiment.ext_test_case.hide_stdout(f: Callable | None = None) Callable[source]

Catches warnings.

Parameters:

f – the function is called with the stdout as an argument

experimental_experiment.ext_test_case.ignore_warnings(warns: List[Warning]) Callable[source]

Catches warnings.

Parameters:

warns – warnings to ignore

experimental_experiment.ext_test_case.is_azure() bool[source]

Tells if the job is running on Azure DevOps.

experimental_experiment.ext_test_case.long_test(msg: str = '') Callable[source]

Catches warnings.

Parameters:

f – the function is called with the stdout as an argument

experimental_experiment.ext_test_case.measure_time(stmt: str | Callable, context: Dict[str, Any] | None = None, repeat: int = 10, number: int = 50, warmup: int = 1, div_by_number: bool = True, max_time: float | None = None) Dict[str, str | int | float][source]

Measures a statement and returns the results as a dictionary.

Parameters:
  • stmt – string or callable

  • context – variable to know in a dictionary

  • repeat – average over repeat experiment

  • number – number of executions in one row

  • warmup – number of iteration to do before starting the real measurement

  • div_by_number – divide by the number of executions

  • max_time – execute the statement until the total goes beyond this time (approximatively), repeat is ignored, div_by_number must be set to True

Returns:

dictionary

<<<

from pprint import pprint
from math import cos
from experimental_experiment.ext_test_case import measure_time

res = measure_time(lambda: cos(0.5))
pprint(res)

>>>

    {'average': np.float64(4.432398418430239e-08),
     'context_size': 64,
     'deviation': np.float64(6.2820299396086495e-09),
     'max_exec': np.float64(6.267990102060139e-08),
     'min_exec': np.float64(4.068002454005182e-08),
     'number': 50,
     'repeat': 10,
     'ttime': np.float64(4.432398418430239e-07),
     'warmup_time': 4.02349978685379e-05}

See Timer.repeat for a better understanding of parameter repeat and number. The function returns a duration corresponding to number times the execution of the main statement.

experimental_experiment.ext_test_case.require_diffusers(version: str, msg: str = '', or_older_than: str | None = None) Callable[source]

Skips a unit test if transformers is not recent enough.

experimental_experiment.ext_test_case.requires_cuda(msg: str = '', version: str = '', memory: int = 0)[source]

Skips a test if cuda is not available.

Parameters:
  • msg – to overwrite the message

  • version – minimum version

  • memory – minimun number of Gb to run the test

experimental_experiment.ext_test_case.requires_executorch(version: str, msg: str = '') Callable[source]

Skips a unit test if executorch is not recent enough.

experimental_experiment.ext_test_case.requires_monai(version: str = '', msg: str = '') Callable[source]

Skips a unit test if monai is not recent enough.

experimental_experiment.ext_test_case.requires_numpy(version: str, msg: str = '') Callable[source]

Skips a unit test if numpy is not recent enough.

experimental_experiment.ext_test_case.requires_onnx(version: str, msg: str = '') Callable[source]

Skips a unit test if onnx is not recent enough.

experimental_experiment.ext_test_case.requires_onnxruntime(version: str, msg: str = '') Callable[source]

Skips a unit test if onnxruntime is not recent enough.

experimental_experiment.ext_test_case.requires_onnxruntime_training(push_back_batch: bool = False, ortmodule: bool = False, msg: str = '') Callable[source]

Skips a unit test if onnxruntime is not onnxruntime_training.

experimental_experiment.ext_test_case.requires_onnxscript(version: str, msg: str = '') Callable[source]

Skips a unit test if onnxscript is not recent enough.

experimental_experiment.ext_test_case.requires_pyinstrument(version: str = '', msg: str = '') Callable[source]

Skips a unit test if pyinstrument is not recent enough.

experimental_experiment.ext_test_case.requires_sklearn(version: str, msg: str = '') Callable[source]

Skips a unit test if scikit-learn is not recent enough.

experimental_experiment.ext_test_case.requires_torch(version: str, msg: str = '') Callable[source]

Skips a unit test if pytorch is not recent enough.

experimental_experiment.ext_test_case.requires_transformers(version: str, msg: str = '', or_older_than: str | None = None) Callable[source]

Skips a unit test if transformers is not recent enough.

experimental_experiment.ext_test_case.requires_vocos(version: str = '', msg: str = '') Callable[source]

Skips a unit test if vocos is not recent enough.

experimental_experiment.ext_test_case.requires_zoo(msg: str = '') Callable[source]

Skips a unit test if environment variable ZOO is not equal to 1.

experimental_experiment.ext_test_case.skipif_ci_apple(msg) Callable[source]

Skips a unit test if it runs on azure pipeline on Windows.

experimental_experiment.ext_test_case.skipif_ci_linux(msg) Callable[source]

Skips a unit test if it runs on azure pipeline on Linux.

experimental_experiment.ext_test_case.skipif_ci_windows(msg) Callable[source]

Skips a unit test if it runs on azure pipeline on Windows.

experimental_experiment.ext_test_case.skipif_not_onnxrt(msg) Callable[source]

Skips a unit test if it runs on azure pipeline on Windows.

experimental_experiment.ext_test_case.skipif_transformers(version_to_skip: str | Set[str], msg: str) Callable[source]

Skips a unit test if transformers has a specific version.

experimental_experiment.ext_test_case.statistics_on_file(filename: str) Dict[str, str | int | float][source]

Computes statistics on a file.

<<<

import pprint
from experimental_experiment.ext_test_case import statistics_on_file, __file__

pprint.pprint(statistics_on_file(__file__))

>>>

    {'chars': 23735, 'ext': '.py', 'lines': 798}
experimental_experiment.ext_test_case.statistics_on_folder(folder: str | List[str], pattern: str = '.*[.]((py|rst))$', aggregation: int = 0) List[Dict[str, str | int | float]][source]

Computes statistics on files in a folder.

Parameters:
  • folder – folder or folders to investigate

  • pattern – file pattern

  • aggregation – show the first subfolders

Returns:

list of dictionaries

<<<

import os
import pprint
from experimental_experiment.ext_test_case import statistics_on_folder, __file__

pprint.pprint(statistics_on_folder(os.path.dirname(__file__)))

>>>

    [{'chars': 66, 'ext': '.py', 'lines': 3, 'name': '_bench_test.py'},
     {'chars': 7579, 'ext': '.py', 'lines': 253, 'name': 'torch_test_helper.py'},
     {'chars': 1807, 'ext': '.py', 'lines': 51, 'name': 'checks.py'},
     {'chars': 8424,
      'ext': '.py',
      'lines': 335,
      'name': '_command_lines_parser.py'},
     {'chars': 23735, 'ext': '.py', 'lines': 798, 'name': 'ext_test_case.py'},
     {'chars': 2764, 'ext': '.py', 'lines': 103, 'name': 'onnx_tools.py'},
     {'chars': 21758, 'ext': '.py', 'lines': 785, 'name': 'bench_run.py'},
     {'chars': 14806, 'ext': '.py', 'lines': 542, 'name': 'mini_onnx_builder.py'},
     {'chars': 2876, 'ext': '.py', 'lines': 115, 'name': 'args.py'},
     {'chars': 6258, 'ext': '.py', 'lines': 205, 'name': 'helpers.py'},
     {'chars': 59, 'ext': '.py', 'lines': 3, 'name': '__init__.py'},
     {'chars': 5300, 'ext': '.py', 'lines': 158, 'name': 'model_run.py'},
     {'chars': 65, 'ext': '.py', 'lines': 3, 'name': '__main__.py'},
     {'chars': 4328, 'ext': '.py', 'lines': 187, 'name': 'memory_peak.py'},
     {'chars': 12054,
      'ext': '.py',
      'lines': 419,
      'name': 'gradient/grad_helper.py'},
     {'chars': 17619,
      'ext': '.py',
      'lines': 496,
      'name': 'gradient/loss_helper.py'},
     {'chars': 0, 'ext': '.py', 'lines': 0, 'name': 'gradient/__init__.py'},
     {'chars': 89, 'ext': '.py', 'lines': 2, 'name': 'gradient/ops/__init__.py'},
     {'chars': 671,
      'ext': '.py',
      'lines': 42,
      'name': 'gradient/ops/op_broadcast_gradient_args.py'},
     {'chars': 14210,
      'ext': '.py',
      'lines': 479,
      'name': 'reference/ort_evaluator.py'},
     {'chars': 5499, 'ext': '.py', 'lines': 198, 'name': 'reference/evaluator.py'},
     {'chars': 1111, 'ext': '.py', 'lines': 39, 'name': 'reference/__init__.py'},
     {'chars': 647,
      'ext': '.py',
      'lines': 27,
      'name': 'reference/ops/op_fused_matmul.py'},
     {'chars': 380,
      'ext': '.py',
      'lines': 14,
      'name': 'reference/ops/op_tri_matrix.py'},
     {'chars': 458,
      'ext': '.py',
      'lines': 17,
      'name': 'reference/ops/op_quick_gelu.py'},
     {'chars': 531, 'ext': '.py', 'lines': 15, 'name': 'reference/ops/op_slice.py'},
     {'chars': 907,
      'ext': '.py',
      'lines': 48,
      'name': 'reference/ops/op_constant_of_shape.py'},
     {'chars': 667,
      'ext': '.py',
      'lines': 16,
      'name': 'reference/ops/op_scatternd_of_shape.py'},
     {'chars': 147,
      'ext': '.py',
      'lines': 5,
      'name': 'reference/ops/op_negxplus1.py'},
     {'chars': 220,
      'ext': '.py',
      'lines': 6,
      'name': 'reference/ops/op_simplified_layer_normalization.py'},
     {'chars': 295,
      'ext': '.py',
      'lines': 10,
      'name': 'reference/ops/op_transpose_cast.py'},
     {'chars': 140,
      'ext': '.py',
      'lines': 7,
      'name': 'reference/ops/op_memcpy_host.py'},
     {'chars': 1405,
      'ext': '.py',
      'lines': 51,
      'name': 'reference/ops/op_average_pool_grad.py'},
     {'chars': 317,
      'ext': '.py',
      'lines': 9,
      'name': 'reference/ops/op_gather_grad.py'},
     {'chars': 384,
      'ext': '.py',
      'lines': 13,
      'name': 'reference/ops/op_bias_softmax.py'},
     {'chars': 224,
      'ext': '.py',
      'lines': 10,
      'name': 'reference/ops/op_replace_zero.py'},
     {'chars': 455,
      'ext': '.py',
      'lines': 17,
      'name': 'reference/ops/op_mul_sigmoid.py'},
     {'chars': 0, 'ext': '.py', 'lines': 0, 'name': 'reference/ops/__init__.py'},
     {'chars': 434,
      'ext': '.py',
      'lines': 16,
      'name': 'reference/ops/op_rotary.py'},
     {'chars': 383,
      'ext': '.py',
      'lines': 11,
      'name': 'reference/ops/op_concat.py'},
     {'chars': 1091,
      'ext': '.py',
      'lines': 44,
      'name': 'reference/ops/op_add_add_mul_mul.py'},
     {'chars': 2148,
      'ext': '.py',
      'lines': 79,
      'name': 'reference/ops/op_scatter_elements.py'},
     {'chars': 990,
      'ext': '.py',
      'lines': 31,
      'name': 'reference/ops/op_cast_like.py'},
     {'chars': 852, 'ext': '.py', 'lines': 23, 'name': 'convert/ort_helper.py'},
     {'chars': 4887,
      'ext': '.py',
      'lines': 149,
      'name': 'convert/convert_helper.py'},
     {'chars': 0, 'ext': '.py', 'lines': 0, 'name': 'convert/__init__.py'},
     {'chars': 6285, 'ext': '.py', 'lines': 377, 'name': 'plotting/data.py'},
     {'chars': 1893, 'ext': '.py', 'lines': 54, 'name': 'plotting/memory.py'},
     {'chars': 0, 'ext': '.py', 'lines': 0, 'name': 'plotting/__init__.py'},
     {'chars': 152, 'ext': '.py', 'lines': 4, 'name': 'torch_interpreter/_doc_.py'},
     {'chars': 10644,
      'ext': '.py',
      'lines': 416,
      'name': 'torch_interpreter/_aten_methods.py'},
     {'chars': 6873,
      'ext': '.py',
      'lines': 246,
      'name': 'torch_interpreter/dispatcher.py'},
     {'chars': 528,
      'ext': '.py',
      'lines': 21,
      'name': 'torch_interpreter/aten_methods.py'},
     {'chars': 54707,
      'ext': '.py',
      'lines': 1745,
      'name': 'torch_interpreter/interpreter.py'},
     {'chars': 17931,
      'ext': '.py',
      'lines': 571,
      'name': 'torch_interpreter/tracing.py'},
     {'chars': 27188,
      'ext': '.py',
      'lines': 842,
      'name': 'torch_interpreter/onnx_export.py'},
     {'chars': 793,
      'ext': '.py',
      'lines': 29,
      'name': 'torch_interpreter/_torch_helper.py'},
     {'chars': 87,
      'ext': '.py',
      'lines': 2,
      'name': 'torch_interpreter/_exceptions.py'},
     {'chars': 10210,
      'ext': '.py',
      'lines': 454,
      'name': 'torch_interpreter/_prims_functions.py'},
     {'chars': 200008,
      'ext': '.py',
      'lines': 7895,
      'name': 'torch_interpreter/_aten_functions.py'},
     {'chars': 8941,
      'ext': '.py',
      'lines': 294,
      'name': 'torch_interpreter/_aten_functions_attention.py'},
     {'chars': 1807,
      'ext': '.py',
      'lines': 59,
      'name': 'torch_interpreter/aten_functions.py'},
     {'chars': 382,
      'ext': '.py',
      'lines': 9,
      'name': 'torch_interpreter/__init__.py'},
     {'chars': 5675,
      'ext': '.py',
      'lines': 200,
      'name': 'torch_interpreter/oxs_dispatcher.py'},
     {'chars': 3949,
      'ext': '.py',
      'lines': 178,
      'name': 'torch_interpreter/oxs_opset.py'},
     {'chars': 13823,
      'ext': '.py',
      'lines': 368,
      'name': 'torch_interpreter/onnx_export_errors.py'},
     {'chars': 12869,
      'ext': '.py',
      'lines': 397,
      'name': 'torch_interpreter/export_options.py'},
     {'chars': 5583,
      'ext': '.py',
      'lines': 162,
      'name': 'torch_interpreter/patches/patch_transformers.py'},
     {'chars': 1514,
      'ext': '.py',
      'lines': 44,
      'name': 'torch_interpreter/patches/patch_torch.py'},
     {'chars': 0,
      'ext': '.py',
      'lines': 0,
      'name': 'torch_interpreter/patches/__init__.py'},
     {'chars': 16209,
      'ext': '.py',
      'lines': 494,
      'name': 'torch_interpreter/eval/model_cases.py'},
     {'chars': 15444,
      'ext': '.py',
      'lines': 607,
      'name': 'torch_interpreter/eval/__init__.py'},
     {'chars': 6708,
      'ext': '.py',
      'lines': 214,
      'name': 'torch_models/llm_model_setup.py'},
     {'chars': 3979,
      'ext': '.py',
      'lines': 140,
      'name': 'torch_models/phi3_helper.py'},
     {'chars': 1651,
      'ext': '.py',
      'lines': 61,
      'name': 'torch_models/diffusion_model_helper.py'},
     {'chars': 5873,
      'ext': '.py',
      'lines': 204,
      'name': 'torch_models/dump_helper.py'},
     {'chars': 7533,
      'ext': '.py',
      'lines': 218,
      'name': 'torch_models/training_helper.py'},
     {'chars': 3414,
      'ext': '.py',
      'lines': 118,
      'name': 'torch_models/mistral_helper.py'},
     {'chars': 847, 'ext': '.py', 'lines': 27, 'name': 'torch_models/__init__.py'},
     {'chars': 23194,
      'ext': '.py',
      'lines': 922,
      'name': 'torch_models/llm_model_helper.py'},
     {'chars': 6031,
      'ext': '.py',
      'lines': 165,
      'name': 'torch_models/llama_helper.py'},
     {'chars': 3802,
      'ext': '.py',
      'lines': 132,
      'name': 'torch_models/phi_helper.py'},
     {'chars': 8104,
      'ext': '.py',
      'lines': 210,
      'name': 'torch_models/fromhub/configuration_phi3_v.py'},
     {'chars': 65678,
      'ext': '.py',
      'lines': 1775,
      'name': 'torch_models/fromhub/modeling_phi3_v.py'},
     {'chars': 0,
      'ext': '.py',
      'lines': 0,
      'name': 'torch_models/fromhub/__init__.py'},
     {'chars': 3205,
      'ext': '.py',
      'lines': 84,
      'name': 'torch_models/dummy_inputs/llm_dummy_inputs.py'},
     {'chars': 1499,
      'ext': '.py',
      'lines': 45,
      'name': 'torch_models/dummy_inputs/__init__.py'},
     {'chars': 4090,
      'ext': '.py',
      'lines': 144,
      'name': 'xbuilder/type_inference.py'},
     {'chars': 4942,
      'ext': '.py',
      'lines': 198,
      'name': 'xbuilder/graph_builder_opset.py'},
     {'chars': 26246,
      'ext': '.py',
      'lines': 850,
      'name': 'xbuilder/shape_type_compute.py'},
     {'chars': 5354,
      'ext': '.py',
      'lines': 179,
      'name': 'xbuilder/model_container.py'},
     {'chars': 334,
      'ext': '.py',
      'lines': 10,
      'name': 'xbuilder/virtual_tensor.py'},
     {'chars': 1716,
      'ext': '.py',
      'lines': 63,
      'name': 'xbuilder/expression_dimension.py'},
     {'chars': 203189,
      'ext': '.py',
      'lines': 6637,
      'name': 'xbuilder/graph_builder.py'},
     {'chars': 3266,
      'ext': '.py',
      'lines': 106,
      'name': 'xbuilder/_shape_helper.py'},
     {'chars': 2143,
      'ext': '.py',
      'lines': 80,
      'name': 'xbuilder/_dtype_helper.py'},
     {'chars': 6347,
      'ext': '.py',
      'lines': 259,
      'name': 'xbuilder/_onnx_helper.py'},
     {'chars': 396, 'ext': '.py', 'lines': 11, 'name': 'xbuilder/__init__.py'},
     {'chars': 11421,
      'ext': '.py',
      'lines': 399,
      'name': 'xbuilder/_graph_builder_runtime.py'},
     {'chars': 4045,
      'ext': '.py',
      'lines': 108,
      'name': 'xbuilder/optimization_options.py'},
     {'chars': 31882,
      'ext': '.py',
      'lines': 1052,
      'name': 'xoptim/patterns_api.py'},
     {'chars': 4221, 'ext': '.py', 'lines': 170, 'name': 'xoptim/order_optim.py'},
     {'chars': 2873, 'ext': '.py', 'lines': 105, 'name': 'xoptim/__init__.py'},
     {'chars': 30653,
      'ext': '.py',
      'lines': 1066,
      'name': 'xoptim/graph_builder_optim.py'},
     {'chars': 1816,
      'ext': '.py',
      'lines': 48,
      'name': 'xoptim/patterns_investigation/__init__.py'},
     {'chars': 1213,
      'ext': '.py',
      'lines': 44,
      'name': 'xoptim/patterns_investigation/element_wise.py'},
     {'chars': 6114,
      'ext': '.py',
      'lines': 171,
      'name': 'xoptim/patterns_investigation/llm_patterns.py'},
     {'chars': 9874,
      'ext': '.py',
      'lines': 321,
      'name': 'xoptim/patterns_ml/tree_ensemble.py'},
     {'chars': 522,
      'ext': '.py',
      'lines': 18,
      'name': 'xoptim/patterns_ml/__init__.py'},
     {'chars': 3969,
      'ext': '.py',
      'lines': 122,
      'name': 'xoptim/patterns_exp/constant_of_shape_scatter_nd.py'},
     {'chars': 3185,
      'ext': '.py',
      'lines': 95,
      'name': 'xoptim/patterns_exp/constants.py'},
     {'chars': 2528,
      'ext': '.py',
      'lines': 76,
      'name': 'xoptim/patterns_exp/unary_operators.py'},
     {'chars': 2470,
      'ext': '.py',
      'lines': 81,
      'name': 'xoptim/patterns_exp/simple_rotary.py'},
     {'chars': 1567,
      'ext': '.py',
      'lines': 49,
      'name': 'xoptim/patterns_exp/__init__.py'},
     {'chars': 1510,
      'ext': '.py',
      'lines': 47,
      'name': 'xoptim/patterns_exp/where_replace.py'},
     {'chars': 14628,
      'ext': '.py',
      'lines': 481,
      'name': 'xoptim/patterns_exp/binary_operators.py'},
     {'chars': 5007,
      'ext': '.py',
      'lines': 159,
      'name': 'xoptim/patterns/onnx_functions.py'},
     {'chars': 1432,
      'ext': '.py',
      'lines': 46,
      'name': 'xoptim/patterns/onnx_sequence.py'},
     {'chars': 27668,
      'ext': '.py',
      'lines': 881,
      'name': 'xoptim/patterns/onnx_matmul.py'},
     {'chars': 5413,
      'ext': '.py',
      'lines': 191,
      'name': 'xoptim/patterns/onnx_any.py'},
     {'chars': 8974,
      'ext': '.py',
      'lines': 291,
      'name': 'xoptim/patterns/onnx_mul.py'},
     {'chars': 16159,
      'ext': '.py',
      'lines': 498,
      'name': 'xoptim/patterns/onnx_layer_normalization.py'},
     {'chars': 16578,
      'ext': '.py',
      'lines': 517,
      'name': 'xoptim/patterns/onnx_rotary.py'},
     {'chars': 11002,
      'ext': '.py',
      'lines': 341,
      'name': 'xoptim/patterns/onnx_reshape.py'},
     {'chars': 1609,
      'ext': '.py',
      'lines': 47,
      'name': 'xoptim/patterns/onnx_equal.py'},
     {'chars': 5496,
      'ext': '.py',
      'lines': 168,
      'name': 'xoptim/patterns/onnx_expand.py'},
     {'chars': 1429,
      'ext': '.py',
      'lines': 47,
      'name': 'xoptim/patterns/onnx_clip.py'},
     {'chars': 8901,
      'ext': '.py',
      'lines': 294,
      'name': 'xoptim/patterns/onnx_cast.py'},
     {'chars': 1476,
      'ext': '.py',
      'lines': 45,
      'name': 'xoptim/patterns/onnx_unsqueeze.py'},
     {'chars': 2571,
      'ext': '.py',
      'lines': 83,
      'name': 'xoptim/patterns/onnx_sub.py'},
     {'chars': 1077,
      'ext': '.py',
      'lines': 37,
      'name': 'xoptim/patterns/onnx_conv.py'},
     {'chars': 2432,
      'ext': '.py',
      'lines': 73,
      'name': 'xoptim/patterns/onnx_reduce.py'},
     {'chars': 3118,
      'ext': '.py',
      'lines': 103,
      'name': 'xoptim/patterns/onnx_split.py'},
     {'chars': 4296,
      'ext': '.py',
      'lines': 130,
      'name': 'xoptim/patterns/__init__.py'},
     {'chars': 6641,
      'ext': '.py',
      'lines': 246,
      'name': 'xoptim/patterns/onnx_transpose.py'},
     {'chars': 3025,
      'ext': '.py',
      'lines': 107,
      'name': 'xoptim/patterns/onnx_slice.py'},
     {'chars': 1136,
      'ext': '.py',
      'lines': 42,
      'name': 'xoptim/patterns/onnx_dropout.py'},
     {'chars': 1241,
      'ext': '.py',
      'lines': 42,
      'name': 'xoptim/patterns_ort/fused_conv.py'},
     {'chars': 5917,
      'ext': '.py',
      'lines': 188,
      'name': 'xoptim/patterns_ort/activation.py'},
     {'chars': 1456,
      'ext': '.py',
      'lines': 49,
      'name': 'xoptim/patterns_ort/gather_grad.py'},
     {'chars': 1929,
      'ext': '.py',
      'lines': 55,
      'name': 'xoptim/patterns_ort/activation_grad.py'},
     {'chars': 8732,
      'ext': '.py',
      'lines': 318,
      'name': 'xoptim/patterns_ort/fused_matmul.py'},
     {'chars': 4358,
      'ext': '.py',
      'lines': 123,
      'name': 'xoptim/patterns_ort/simplified_layer_normalization.py'},
     {'chars': 1253,
      'ext': '.py',
      'lines': 40,
      'name': 'xoptim/patterns_ort/__init__.py'},
     {'chars': 1283,
      'ext': '.py',
      'lines': 44,
      'name': 'xoptim/patterns_fix/add_reduction_scatter_nd.py'},
     {'chars': 429,
      'ext': '.py',
      'lines': 14,
      'name': 'xoptim/patterns_fix/__init__.py'},
     {'chars': 3533,
      'ext': '.py',
      'lines': 122,
      'name': 'torch_dynamo/dynger_backend.py'},
     {'chars': 9448,
      'ext': '.py',
      'lines': 326,
      'name': 'torch_dynamo/debug_backend.py'},
     {'chars': 19267,
      'ext': '.py',
      'lines': 636,
      'name': 'torch_dynamo/fast_backend.py'},
     {'chars': 2428,
      'ext': '.py',
      'lines': 72,
      'name': 'torch_dynamo/_dynamo_exporter.py'},
     {'chars': 4073,
      'ext': '.py',
      'lines': 128,
      'name': 'torch_dynamo/partition.py'},
     {'chars': 567,
      'ext': '.py',
      'lines': 18,
      'name': 'torch_dynamo/backend_helper.py'},
     {'chars': 6857,
      'ext': '.py',
      'lines': 225,
      'name': 'torch_dynamo/__init__.py'},
     {'chars': 5839,
      'ext': '.py',
      'lines': 165,
      'name': 'torch_bench/dort_profile.py'},
     {'chars': 976,
      'ext': '.py',
      'lines': 21,
      'name': 'torch_bench/bash_bench_huggingface_big.py'},
     {'chars': 17963,
      'ext': '.py',
      'lines': 611,
      'name': 'torch_bench/export_model_helper.py'},
     {'chars': 54413,
      'ext': '.py',
      'lines': 2098,
      'name': 'torch_bench/_bash_bench_benchmark_runner_agg_helper.py'},
     {'chars': 14222,
      'ext': '.py',
      'lines': 510,
      'name': 'torch_bench/_bash_bench_set_huggingface.py'},
     {'chars': 4087,
      'ext': '.py',
      'lines': 376,
      'name': 'torch_bench/_bash_bench_models_helper.py'},
     {'chars': 7582,
      'ext': '.py',
      'lines': 307,
      'name': 'torch_bench/_bash_bench_suites.py'},
     {'chars': 5579,
      'ext': '.py',
      'lines': 191,
      'name': 'torch_bench/bash_bench_agg.py'},
     {'chars': 32160,
      'ext': '.py',
      'lines': 1197,
      'name': 'torch_bench/_bash_bench_benchmark_runner_agg.py'},
     {'chars': 791,
      'ext': '.py',
      'lines': 19,
      'name': 'torch_bench/bash_bench_explicit.py'},
     {'chars': 6334,
      'ext': '.py',
      'lines': 176,
      'name': 'torch_bench/_bash_bench_set_dummies.py'},
     {'chars': 5975,
      'ext': '.py',
      'lines': 197,
      'name': 'torch_bench/dort_bench_profile.py'},
     {'chars': 17151,
      'ext': '.py',
      'lines': 541,
      'name': 'torch_bench/_dort_cmd_common.py'},
     {'chars': 892,
      'ext': '.py',
      'lines': 21,
      'name': 'torch_bench/bash_bench_issues.py'},
     {'chars': 2326,
      'ext': '.py',
      'lines': 89,
      'name': 'torch_bench/_bash_bench_set_issues.py'},
     {'chars': 972,
      'ext': '.py',
      'lines': 27,
      'name': 'torch_bench/bash_bench_torchbench.py'},
     {'chars': 2398,
      'ext': '.py',
      'lines': 92,
      'name': 'torch_bench/_bash_bench_set_explicit.py'},
     {'chars': 49675,
      'ext': '.py',
      'lines': 1610,
      'name': 'torch_bench/_bash_bench_benchmark_runner.py'},
     {'chars': 9839,
      'ext': '.py',
      'lines': 309,
      'name': 'torch_bench/dort_bench.py'},
     {'chars': 994,
      'ext': '.py',
      'lines': 27,
      'name': 'torch_bench/bash_bench_torchbench_ado.py'},
     {'chars': 54168,
      'ext': '.py',
      'lines': 1921,
      'name': 'torch_bench/_bash_bench_model_runner.py'},
     {'chars': 827,
      'ext': '.py',
      'lines': 19,
      'name': 'torch_bench/bash_bench_timm.py'},
     {'chars': 48, 'ext': '.py', 'lines': 1, 'name': 'torch_bench/__init__.py'},
     {'chars': 2675,
      'ext': '.py',
      'lines': 97,
      'name': 'torch_bench/_bash_bench_set_huggingface_big.py'},
     {'chars': 10017,
      'ext': '.py',
      'lines': 315,
      'name': 'torch_bench/_bash_bench_cmd.py'},
     {'chars': 13484,
      'ext': '.py',
      'lines': 532,
      'name': 'torch_bench/_bash_bench_set_timm.py'},
     {'chars': 7617,
      'ext': '.py',
      'lines': 264,
      'name': 'torch_bench/_dort_cmd_common_models.py'},
     {'chars': 1319,
      'ext': '.py',
      'lines': 43,
      'name': 'torch_bench/check_model.py'},
     {'chars': 1062,
      'ext': '.py',
      'lines': 23,
      'name': 'torch_bench/bash_bench_huggingface.py'},
     {'chars': 20405,
      'ext': '.py',
      'lines': 820,
      'name': 'torch_bench/_bash_bench_set_torchbench.py'},
     {'chars': 5300,
      'ext': '.py',
      'lines': 174,
      'name': 'torch_bench/export_model.py'},
     {'chars': 897,
      'ext': '.py',
      'lines': 34,
      'name': 'torch_bench/_bash_bench_set_torchbench_ado.py'},
     {'chars': 801,
      'ext': '.py',
      'lines': 19,
      'name': 'torch_bench/bash_bench_untrained.py'},
     {'chars': 685,
      'ext': '.py',
      'lines': 27,
      'name': 'torch_bench/big_models/try_minilm_test.py'},
     {'chars': 3273,
      'ext': '.py',
      'lines': 109,
      'name': 'torch_bench/big_models/try_minilm.py'},
     {'chars': 1825,
      'ext': '.py',
      'lines': 60,
      'name': 'torch_bench/big_models/try_falcon_mamba_test.py'},
     {'chars': 686,
      'ext': '.py',
      'lines': 27,
      'name': 'torch_bench/big_models/try_smollm_test.py'},
     {'chars': 2448,
      'ext': '.py',
      'lines': 93,
      'name': 'torch_bench/big_models/try_codellama.py'},
     {'chars': 2620,
      'ext': '.py',
      'lines': 93,
      'name': 'torch_bench/big_models/try_falcon_mamba.py'},
     {'chars': 914,
      'ext': '.py',
      'lines': 31,
      'name': 'torch_bench/big_models/try_flux_t5_test.py'},
     {'chars': 2922,
      'ext': '.py',
      'lines': 96,
      'name': 'torch_bench/big_models/try_stable_diffusion_3.py'},
     {'chars': 1582,
      'ext': '.py',
      'lines': 34,
      'name': 'torch_bench/big_models/main_spy_phi2.py'},
     {'chars': 2749,
      'ext': '.py',
      'lines': 88,
      'name': 'torch_bench/big_models/try_phi35_vision_test.py'},
     {'chars': 3160,
      'ext': '.py',
      'lines': 81,
      'name': 'torch_bench/big_models/main_spy_phi35_vision.py'},
     {'chars': 2344,
      'ext': '.py',
      'lines': 71,
      'name': 'torch_bench/big_models/try_phi35_mini_instruct_test.py'},
     {'chars': 935,
      'ext': '.py',
      'lines': 32,
      'name': 'torch_bench/big_models/try_flux_transformer_test.py'},
     {'chars': 21096,
      'ext': '.py',
      'lines': 296,
      'name': 'torch_bench/big_models/main_spy_phi35_vision_dummy.py'},
     {'chars': 2339,
      'ext': '.py',
      'lines': 87,
      'name': 'torch_bench/big_models/try_smollm.py'},
     {'chars': 1618,
      'ext': '.py',
      'lines': 51,
      'name': 'torch_bench/big_models/__init__.py'},
     {'chars': 1864,
      'ext': '.py',
      'lines': 67,
      'name': 'torch_bench/big_models/try_flux_transformer.py'},
     {'chars': 692,
      'ext': '.py',
      'lines': 27,
      'name': 'torch_bench/big_models/try_codellama_test.py'},
     {'chars': 4514,
      'ext': '.py',
      'lines': 844,
      'name': 'torch_bench/big_models/try_phi35_vision.py'},
     {'chars': 1453,
      'ext': '.py',
      'lines': 49,
      'name': 'torch_bench/big_models/try_phi35_mini_instruct.py'},
     {'chars': 688,
      'ext': '.py',
      'lines': 26,
      'name': 'torch_bench/big_models/try_stable_diffusion_3_test.py'},
     {'chars': 1205,
      'ext': '.py',
      'lines': 47,
      'name': 'torch_bench/big_models/try_flux_t5.py'}]
experimental_experiment.ext_test_case.unit_test_going()[source]

Enables a flag telling the script is running while testing it. Avois unit tests to be very long.

experimental_experiment.ext_test_case.with_path_append(path_to_add: str | List[str]) Callable[source]

Adds a path to sys.path to check.