Skip to content

Commit b1622fd

Browse files
committed
Fixed error with Rice 4.8
1 parent f7865e5 commit b1622fd

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- Changed `Tensor#device` method to return `Device` instead of string
44
- Fixed `item` method for multi-dimensional tensors
5+
- Fixed error with Rice 4.8
56

67
## 0.22.2 (2025-11-04)
78

ext/torch/templates.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ namespace Rice::detail {
6969

7070
explicit From_Ruby(Arg* arg) : arg_(arg) { }
7171

72-
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
72+
double is_convertible(VALUE value) { return Convertible::Exact; }
7373

7474
c10::complex<T> convert(VALUE x) {
7575
VALUE real = rb_funcall(x, rb_intern("real"), 0);
@@ -93,7 +93,7 @@ namespace Rice::detail {
9393

9494
explicit From_Ruby(Arg* arg) : arg_(arg) { }
9595

96-
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
96+
double is_convertible(VALUE value) { return Convertible::Exact; }
9797

9898
FanModeType convert(VALUE x) {
9999
auto s = String(x).str();
@@ -122,7 +122,7 @@ namespace Rice::detail {
122122

123123
explicit From_Ruby(Arg* arg) : arg_(arg) { }
124124

125-
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
125+
double is_convertible(VALUE value) { return Convertible::Exact; }
126126

127127
NonlinearityType convert(VALUE x) {
128128
auto s = String(x).str();
@@ -169,7 +169,7 @@ namespace Rice::detail {
169169

170170
explicit From_Ruby(Arg* arg) : arg_(arg) { }
171171

172-
Convertible is_convertible(VALUE value) { return Convertible::Cast; }
172+
double is_convertible(VALUE value) { return Convertible::Exact; }
173173

174174
Scalar convert(VALUE x) {
175175
if (FIXNUM_P(x)) {

torch-rb.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ Gem::Specification.new do |spec|
1616

1717
spec.required_ruby_version = ">= 3.2"
1818

19-
spec.add_dependency "rice", ">= 4.7"
19+
spec.add_dependency "rice", ">= 4.8"
2020
end

0 commit comments

Comments
 (0)