torch-rb 0.16.0 → 0.17.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/README.md +2 -1
- data/codegen/generate_functions.rb +6 -6
- data/codegen/native_functions.yaml +269 -161
- data/ext/torch/fft_functions.h +6 -0
- data/ext/torch/linalg_functions.h +6 -0
- data/ext/torch/nn_functions.h +6 -0
- data/ext/torch/sparse_functions.h +6 -0
- data/ext/torch/special_functions.h +6 -0
- data/ext/torch/tensor_functions.h +6 -0
- data/ext/torch/torch_functions.h +6 -0
- data/ext/torch/utils.h +1 -1
- data/lib/torch/nn/functional.rb +11 -1
- data/lib/torch/nn/functional_attention.rb +5 -5
- data/lib/torch/nn/module.rb +24 -4
- data/lib/torch/tensor.rb +10 -4
- data/lib/torch/version.rb +1 -1
- metadata +11 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f04aeddd9c66d668f78ed38d831ec66907743fd5be2cd076e9e547d00f1f2aa3
|
4
|
+
data.tar.gz: e76ca5199c4801c0eaa760ed3e41ebb6e521774bba084809656b1ed9e4b96483
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 683246aa91d19daa624a9d3a89fa5e4898f19fbb45a72ff2bcac0ee3025859f0f8ad26ac153e58150aedf10547cf670e2fe131cffda246546ded1f1344637040
|
7
|
+
data.tar.gz: bd0b955b997f09a274d8b59a21eafa8bf45972b6a20883b9d457a29417aa2c6d413b324abadfb6772c5bdc3aa0e633d3e25d6f23dd986fa603c55c69ae4a5a85
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
## 0.17.1 (2024-08-19)
|
2
|
+
|
3
|
+
- Added `persistent` option to `register_buffer` method
|
4
|
+
- Added `prefix` and `recurse` options to `named_buffers` method
|
5
|
+
|
6
|
+
## 0.17.0 (2024-07-26)
|
7
|
+
|
8
|
+
- Updated LibTorch to 2.4.0
|
9
|
+
- Added `normalize` method
|
10
|
+
- Added support for tensor indexing with arrays
|
11
|
+
|
1
12
|
## 0.16.0 (2024-06-12)
|
2
13
|
|
3
14
|
- Updated LibTorch to 2.3.0
|
data/README.md
CHANGED
@@ -26,7 +26,7 @@ Add this line to your application’s Gemfile:
|
|
26
26
|
gem "torch-rb"
|
27
27
|
```
|
28
28
|
|
29
|
-
It can take 5-10 minutes to compile the extension.
|
29
|
+
It can take 5-10 minutes to compile the extension. Windows is not currently supported.
|
30
30
|
|
31
31
|
## Getting Started
|
32
32
|
|
@@ -410,6 +410,7 @@ Here’s the list of compatible versions.
|
|
410
410
|
|
411
411
|
Torch.rb | LibTorch
|
412
412
|
--- | ---
|
413
|
+
0.17.x | 2.4.x
|
413
414
|
0.16.x | 2.3.x
|
414
415
|
0.15.x | 2.2.x
|
415
416
|
0.14.x | 2.1.x
|
@@ -155,10 +155,10 @@ def generate_attach_def(name, type, def_method)
|
|
155
155
|
end
|
156
156
|
|
157
157
|
ruby_name = "_#{ruby_name}" if ["size", "stride", "random!"].include?(ruby_name)
|
158
|
-
ruby_name = ruby_name.
|
159
|
-
ruby_name = ruby_name.
|
160
|
-
ruby_name = ruby_name.
|
161
|
-
ruby_name = ruby_name.
|
158
|
+
ruby_name = ruby_name.delete_prefix("fft_") if type == "fft"
|
159
|
+
ruby_name = ruby_name.delete_prefix("linalg_") if type == "linalg"
|
160
|
+
ruby_name = ruby_name.delete_prefix("special_") if type == "special"
|
161
|
+
ruby_name = ruby_name.delete_prefix("sparse_") if type == "sparse"
|
162
162
|
ruby_name = name if name.start_with?("__")
|
163
163
|
|
164
164
|
"rb_#{def_method}(m, \"#{ruby_name}\", #{full_name(name, type)}, -1);"
|
@@ -216,7 +216,7 @@ def add_dispatch(function, def_method)
|
|
216
216
|
out_code = generate_dispatch(function["out"], def_method)
|
217
217
|
out_index = function["out"].out_index
|
218
218
|
|
219
|
-
|
219
|
+
"if (_r.isNone(#{out_index})) {
|
220
220
|
#{indent(base_code)}
|
221
221
|
} else {
|
222
222
|
#{indent(out_code)}
|
@@ -439,7 +439,7 @@ def generate_function_params(function, params, remove_self)
|
|
439
439
|
else
|
440
440
|
"#{func}Optional"
|
441
441
|
end
|
442
|
-
|
442
|
+
end
|
443
443
|
|
444
444
|
"_r.#{func}(#{param[:position]})"
|
445
445
|
end
|