Parse native_functions.yaml into NativeFunctions and an Operator Indexed Dict of fields to persist from native_functions.yaml to functions.yaml
(
path: str,
tags_yaml_path: str,
ignore_keys: set[DispatchKey] | None = None,
skip_native_fns_gen: bool = False,
)
| 123 | |
| 124 | |
| 125 | def parse_et_yaml( |
| 126 | path: str, |
| 127 | tags_yaml_path: str, |
| 128 | ignore_keys: set[DispatchKey] | None = None, |
| 129 | skip_native_fns_gen: bool = False, |
| 130 | ) -> tuple[list[NativeFunction], dict[OperatorName, dict[str, Any]]]: |
| 131 | """Parse native_functions.yaml into NativeFunctions and an Operator Indexed Dict |
| 132 | of fields to persist from native_functions.yaml to functions.yaml |
| 133 | """ |
| 134 | with open(path) as f: |
| 135 | es = yaml.load(f, Loader=LineLoader) |
| 136 | |
| 137 | et_kernel = extract_kernel_fields(es) |
| 138 | |
| 139 | # Remove ET specific fields from entries for BC compatibility |
| 140 | strip_et_fields(es) |
| 141 | |
| 142 | native_yaml = parse_native_yaml( |
| 143 | path, |
| 144 | tags_yaml_path, |
| 145 | ignore_keys, |
| 146 | skip_native_fns_gen=skip_native_fns_gen, |
| 147 | loaded_yaml=es, |
| 148 | ) |
| 149 | return native_yaml.native_functions, et_kernel |
| 150 | |
| 151 | |
| 152 | def strip_et_fields(es: object) -> None: |
no test coverage detected