ext/torch/utils.h in torch-rb-0.11.2 vs ext/torch/utils.h in torch-rb-0.12.0

- old
+ new

@@ -4,11 +4,11 @@ #include <rice/rice.hpp> #include <rice/stl.hpp> static_assert( - TORCH_VERSION_MAJOR == 1 && TORCH_VERSION_MINOR == 12, + TORCH_VERSION_MAJOR == 1 && TORCH_VERSION_MINOR == 13, "Incompatible LibTorch version" ); // TODO find better place inline void handle_error(torch::Error const & ex) { @@ -31,9 +31,13 @@ inline bool THPUtils_checkSymbol(VALUE obj) { return SYMBOL_P(obj); } inline bool THPUtils_checkIndex(VALUE obj) { + return FIXNUM_P(obj); +} + +inline bool THPUtils_checkLong(VALUE obj) { return FIXNUM_P(obj); } inline bool THPUtils_checkScalar(VALUE obj) { return FIXNUM_P(obj) || RB_FLOAT_TYPE_P(obj) || RB_TYPE_P(obj, T_COMPLEX);