ext/torch/templates.h in torch-rb-0.14.1 vs ext/torch/templates.h in torch-rb-0.15.0
- old
+ new
@@ -167,29 +167,6 @@
} else {
return torch::Scalar(From_Ruby<double>().convert(x));
}
}
};
-
- template<typename T>
- struct Type<torch::optional<T>>
- {
- static bool verify()
- {
- return true;
- }
- };
-
- template<typename T>
- class From_Ruby<torch::optional<T>>
- {
- public:
- torch::optional<T> convert(VALUE x)
- {
- if (NIL_P(x)) {
- return torch::nullopt;
- } else {
- return torch::optional<T>{From_Ruby<T>().convert(x)};
- }
- }
- };
}