torch-rb 0.10.1 → 0.10.2

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: f4665eec43d85fbf02ce75f4b268dbf001bfad7e3ae1ecace0e9911b651e2cc2
4
- data.tar.gz: d11ee1386ce7feeea68333de6c361d8737a7164cfd1626abce3a511deecb2963
3
+ metadata.gz: 935c88d7ce2a1f9d0f12014dd4f79beee6d1c153bc2439f614f00f50ec60c286
4
+ data.tar.gz: d77145dd7944d0ec024e5bef00d6ba1d47e52efb74c1d731101b8b8e67c9a3c9
5
5
  SHA512:
6
- metadata.gz: cf346bc03f36d4fc920151b0554c93c33a59d0fecd35c6f110dc862ad8b35c6b8641d306124505ddd012ce9d903363672e99772cc2bd7b981d962c9d00f08d3e
7
- data.tar.gz: 265157846417fdc3c024e0f50d0b0a663d345ca423ad9233a7d0e722bf5134a8e15e1afce30248992155787484e80311e484c64c5787945b5f5a88625115479a
6
+ metadata.gz: d9b4df4b90ff11b67d4c203a2e5f59037a6079dafb16ec02bae89a34f364ca86a5530dcb74adce48474c857ce2f2ce49323d96830fb30c843440b842b6e7fb50
7
+ data.tar.gz: a68bf5d89984861c847390a4aaea337bc86a43c01ee93de47f575b52a87b7281e3318fcf10d70f0db5013f9685a126a46d80e42f88bbf51080bd15fac1933f71
data/CHANGELOG.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.10.2 (2022-06-14)
2
+
3
+ - Improved numeric operations between scalars and tensors
4
+ - Fixed `dtype` of `cumsum` method
5
+
1
6
  ## 0.10.1 (2022-04-12)
2
7
 
3
8
  - Fixed `dtype`, `device`, and `layout` for `new_*` and `like_*` methods
data/README.md CHANGED
@@ -421,13 +421,25 @@ Torch.rb | LibTorch
421
421
 
422
422
  ### Homebrew
423
423
 
424
- For Mac, you can use Homebrew.
424
+ You can also use Homebrew.
425
425
 
426
426
  ```sh
427
427
  brew install libtorch
428
428
  ```
429
429
 
430
- Then install the gem (no need for `bundle config`).
430
+ For Mac ARM, run:
431
+
432
+ ```sh
433
+ bundle config build.torch-rb --with-torch-dir=/opt/homebrew
434
+ ```
435
+
436
+ And for Linux, run:
437
+
438
+ ```sh
439
+ bundle config build.torch-rb --with-torch-dir=/home/linuxbrew/.linuxbrew
440
+ ```
441
+
442
+ Then install the gem.
431
443
 
432
444
  ## Performance
433
445
 
data/codegen/function.rb CHANGED
@@ -60,7 +60,7 @@ class Function
60
60
 
61
61
  optional = false
62
62
  if type.include?("?")
63
- optional = true unless ["dtype", "device", "layout", "pin_memory"].include?(name)
63
+ optional = true
64
64
  type = type.delete("?")
65
65
  end
66
66
 
data/lib/torch/tensor.rb CHANGED
@@ -199,5 +199,13 @@ module Torch
199
199
  def real
200
200
  Torch.real(self)
201
201
  end
202
+
203
+ def coerce(other)
204
+ if other.is_a?(Numeric)
205
+ [Torch.tensor(other), self]
206
+ else
207
+ raise TypeError, "#{self.class} can't be coerced into #{other.class}"
208
+ end
209
+ end
202
210
  end
203
211
  end
data/lib/torch/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Torch
2
- VERSION = "0.10.1"
2
+ VERSION = "0.10.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torch-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.10.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Kane
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-12 00:00:00.000000000 Z
11
+ date: 2022-06-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rice