mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/34774 This PR provides pybind11's `type_caster<at::Generator>` that allows mapping `at::Generator` instance returned from user-defined method to python `torch::Generator`, defined as `THPGenerator ` c++ class. This allows 1) defining custom RNG in c++ extension 2) using custom RNG in python code. `TestRNGExtension.test_rng` shows how to use custom RNG defined in `rng_extension.cpp` Test Plan: Imported from OSS Differential Revision: D20549451 Pulled By: pbelevich fbshipit-source-id: 312a6deccf8228f7f60695bbf95834620d52f5eb |
||
|---|---|---|
| .. | ||
| no_python_abi_suffix_test | ||
| torch_test_cpp_extension | ||
| complex_registration_extension.cpp | ||
| cpp_frontend_extension.cpp | ||
| cuda_extension_kernel.cu | ||
| cuda_extension_kernel2.cu | ||
| cuda_extension.cpp | ||
| cuda_extension.cu | ||
| cudnn_extension.cpp | ||
| doubler.h | ||
| extension.cpp | ||
| jit_extension.cpp | ||
| jit_extension2.cpp | ||
| msnpu_extension.cpp | ||
| rng_extension.cpp | ||
| setup.py | ||