torch-rb 0.15.0 → 0.17.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5cb7d8bf760b3f2a52976b0fda929cd7227a89ed7475b19a87cd9ce53ab5fe4e
4
- data.tar.gz: 9977b9740c8490b4be11682dbd700bfe1175cf1f109e81412a694c4a4fd4a043
3
+ metadata.gz: cd28e938ac0d61829d538f4a36e9f3377f06257ab08fd3ec8d8e3912194a101a
4
+ data.tar.gz: 7bbb0c98e783c4a02e4ca46a1835c591fff3630c84d1a44abf1ef8df75c45de7
5
5
  SHA512:
6
- metadata.gz: fb7283603fff1ad25fd234926abaeaafada2f0def3b5a52051242f3348445a5e4b615680f414d09c72a502c355fade701e79867444dd848c8dcd989f42359f19
7
- data.tar.gz: bb41a341f271fb5bce47ad6e1a6ef223b6d7c01165a86de13681d25720c96d5a17de81e549439feedcf482c4e539083e3e04e97a768999438b939bc235fb652d
6
+ metadata.gz: 38415fe461d01d11d620d2072012ea6a86ad000e5d25920af3d2d4cd05c3b088479cb60a2bd2b6dc013da51e3f744913b3d734fc949ac2708b825c3c041f8c52
7
+ data.tar.gz: 2c54b30ccfa91f9b7576f7927377c03a9d82b7ff8aaf561e92ad89b2b00a2e7e3e08c268d606e6609cbaa13d2dc2e5e11c8329bf1b3475af7025a21dc8a1921f
data/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## 0.17.0 (2024-07-26)
2
+
3
+ - Updated LibTorch to 2.4.0
4
+ - Added `normalize` method
5
+ - Added support for tensor indexing with arrays
6
+
7
+ ## 0.16.0 (2024-06-12)
8
+
9
+ - Updated LibTorch to 2.3.0
10
+ - Added `ELU` and `GELU` classes
11
+ - Dropped support for Ruby < 3.1
12
+
1
13
  ## 0.15.0 (2024-02-28)
2
14
 
3
15
  - Updated LibTorch to 2.2.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,8 @@ Here’s the list of compatible versions.
410
410
 
411
411
  Torch.rb | LibTorch
412
412
  --- | ---
413
+ 0.17.x | 2.4.x
414
+ 0.16.x | 2.3.x
413
415
  0.15.x | 2.2.x
414
416
  0.14.x | 2.1.x
415
417
  0.13.x | 2.0.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.sub(/\Afft_/, "") if type == "fft"
159
- ruby_name = ruby_name.sub(/\Alinalg_/, "") if type == "linalg"
160
- ruby_name = ruby_name.sub(/\Aspecial_/, "") if type == "special"
161
- ruby_name = ruby_name.sub(/\Asparse_/, "") if type == "sparse"
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
- return "if (_r.isNone(#{out_index})) {
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
- end
442
+ end
443
443
 
444
444
  "_r.#{func}(#{param[:position]})"
445
445
  end