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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +14 -2
- data/codegen/function.rb +1 -1
- data/lib/torch/tensor.rb +8 -0
- data/lib/torch/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 935c88d7ce2a1f9d0f12014dd4f79beee6d1c153bc2439f614f00f50ec60c286
|
4
|
+
data.tar.gz: d77145dd7944d0ec024e5bef00d6ba1d47e52efb74c1d731101b8b8e67c9a3c9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d9b4df4b90ff11b67d4c203a2e5f59037a6079dafb16ec02bae89a34f364ca86a5530dcb74adce48474c857ce2f2ce49323d96830fb30c843440b842b6e7fb50
|
7
|
+
data.tar.gz: a68bf5d89984861c847390a4aaea337bc86a43c01ee93de47f575b52a87b7281e3318fcf10d70f0db5013f9685a126a46d80e42f88bbf51080bd15fac1933f71
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -421,13 +421,25 @@ Torch.rb | LibTorch
|
|
421
421
|
|
422
422
|
### Homebrew
|
423
423
|
|
424
|
-
|
424
|
+
You can also use Homebrew.
|
425
425
|
|
426
426
|
```sh
|
427
427
|
brew install libtorch
|
428
428
|
```
|
429
429
|
|
430
|
-
|
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
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
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.
|
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-
|
11
|
+
date: 2022-06-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rice
|