[Random Generator] Part1: Dev random generator (#5360)
* add random generator
* reformat
* refactor: allow auto generator
* refactor: remove kAUTO, update python api and test
* refactor: use member initializer lists, fix build issue when cpu only
* handle exeception given invalid device
* Refine code style (#5375)
* fix unordered map: enum class not hashable
* roll back to unordered map
Co-authored-by:
Houjiang Chen <chenhoujiangcug@gmail.com>
Showing
- oneflow/api/python/framework/random_generator.cpp 38 additions, 0 deletionsoneflow/api/python/framework/random_generator.cpp
- oneflow/core/framework/random_generator.cpp 100 additions, 0 deletionsoneflow/core/framework/random_generator.cpp
- oneflow/core/framework/random_generator.cu 72 additions, 0 deletionsoneflow/core/framework/random_generator.cu
- oneflow/core/framework/random_generator.h 170 additions, 0 deletionsoneflow/core/framework/random_generator.h
- oneflow/python/framework/generator.py 34 additions, 0 deletionsoneflow/python/framework/generator.py
- oneflow/python/framework/register_class_method_util.py 1 addition, 0 deletionsoneflow/python/framework/register_class_method_util.py
- oneflow/python/test/generator/test_generator.py 43 additions, 0 deletionsoneflow/python/test/generator/test_generator.py
Please register or sign in to comment