ext/torch/random.cpp in torch-rb-0.6.0 vs ext/torch/random.cpp in torch-rb-0.7.0
- old
+ new
@@ -1,21 +1,21 @@
#include <torch/torch.h>
-#include <rice/Module.hpp>
+#include <rice/rice.hpp>
#include "utils.h"
void init_random(Rice::Module& m) {
Rice::define_module_under(m, "Random")
.add_handler<torch::Error>(handle_error)
- .define_singleton_method(
+ .define_singleton_function(
"initial_seed",
- *[]() {
+ []() {
return at::detail::getDefaultCPUGenerator().current_seed();
})
- .define_singleton_method(
+ .define_singleton_function(
"seed",
- *[]() {
+ []() {
// TODO set for CUDA when available
auto generator = at::detail::getDefaultCPUGenerator();
return generator.seed();
});
}