pytorch/tools/codegen
Brian Hirsh 77f98ea5e0 assert no duplicate yaml keys in codegen (#66238)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/66238

The codegen should error if it sees two yaml entries with the same key. The default behavior of python's yaml loader is to overwrite duplicate keys with the new value.

This would have caught a nasty bug that showed up in https://github.com/pytorch/pytorch/pull/66225/files#r723796194.

I tested it on that linked PR, to confirm that it errors correctly (and gives the line number containing the duplicate).

Test Plan: Imported from OSS

Reviewed By: dagitses, albanD, sean-ngo

Differential Revision: D31464585

Pulled By: bdhirsh

fbshipit-source-id: 5b35157ffa9a933bf4b344c4b9fe2878698370a3
2021-10-14 08:28:20 -07:00
..
api Rename int to long, add more C++ types. (#66108) 2021-10-08 08:25:06 -07:00
dest Add checks for structured in-place operations. (#65686) 2021-09-28 13:21:26 -07:00
selective_build
__init__.py
code_template.py
context.py
gen.py [structured] Preserve computed elements from meta func to impl (#61746) 2021-09-01 14:34:25 -07:00
gen_backend_stubs.py
local.py
model.py [structured] Preserve computed elements from meta func to impl (#61746) 2021-09-01 14:34:25 -07:00
utils.py assert no duplicate yaml keys in codegen (#66238) 2021-10-14 08:28:20 -07:00