pytorch/tools/test
Mengwei Liu 5c8a9803c8 [torchgen] Support multiple namespace in NativeFunctions.h (#79733)
Summary:
This is a follow up to #78015. This PR
* introduces namespace logic for generating `NativeFunctions.h`.
* adds helper function to extract namespace from string
* relaxes the constraint on the levels we support for custom kernel namespace to 2

Test Plan:
Yaml entry:
```
- func: unsqueeze.out(Tensor(a) self, int dim, *, Tensor(a!) out) -> Tensor(a!)
  variants: function
  device_check: NoCheck
  dispatch:
    CPU: custom_1::custom_2::unsqueeze
```

Generated `NativeFunctions.h`:

```
namespace custom_1 {
namespace custom_2 {
namespace native {
    TORCH_API at::Tensor & unsqueeze(const at::Tensor & self, int64_t dim, at::Tensor & out);
} // namespace native
} // namespace custom_2
} // namespace custom_1

```

Differential Revision: D37198111

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79733
Approved by: https://github.com/bdhirsh
2022-07-08 21:56:52 +00:00
..
gen_operators_yaml_test.py Consolidate all python targets in the tools folder (#80408) 2022-06-29 23:27:47 +00:00
gen_oplist_test.py Consolidate all python targets in the tools folder (#80408) 2022-06-29 23:27:47 +00:00
test_cmake.py
test_codegen.py Revert "Revert "Allow specifying tags for aten operators in native_functions.yaml"" 2022-04-28 02:04:57 +00:00
test_codegen_model.py Revert "Revert "Allow specifying tags for aten operators in native_functions.yaml"" 2022-04-28 02:04:57 +00:00
test_gen_backend_stubs.py Codegen Non-Native IR Nodes (#76535) 2022-05-24 19:29:23 +00:00
test_import_test_stats.py
test_selective_build.py Consolidate all python targets in the tools folder (#80408) 2022-06-29 23:27:47 +00:00
test_stats.py [lint] upgrade mypy to latest version 2022-05-03 20:51:34 +00:00
test_test_history.py
test_test_selections.py Allow sharding for distributed tests 2022-04-29 03:55:07 +00:00
test_upload_test_stats.py [ci] only upload summarized test stats for PRs (#80295) 2022-06-27 18:40:39 +00:00
test_utils.py [torchgen] Support multiple namespace in NativeFunctions.h (#79733) 2022-07-08 21:56:52 +00:00