torch-rb 0.16.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -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/tensor.rb +3 -1
- data/lib/torch/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cd28e938ac0d61829d538f4a36e9f3377f06257ab08fd3ec8d8e3912194a101a
|
4
|
+
data.tar.gz: 7bbb0c98e783c4a02e4ca46a1835c591fff3630c84d1a44abf1ef8df75c45de7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38415fe461d01d11d620d2072012ea6a86ad000e5d25920af3d2d4cd05c3b088479cb60a2bd2b6dc013da51e3f744913b3d734fc949ac2708b825c3c041f8c52
|
7
|
+
data.tar.gz: 2c54b30ccfa91f9b7576f7927377c03a9d82b7ff8aaf561e92ad89b2b00a2e7e3e08c268d606e6609cbaa13d2dc2e5e11c8329bf1b3475af7025a21dc8a1921f
|
data/CHANGELOG.md
CHANGED
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
|