torch-rb 0.12.2 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +3 -1
- data/codegen/generate_functions.rb +4 -2
- data/codegen/native_functions.yaml +1392 -593
- data/ext/torch/backends.cpp +4 -0
- data/ext/torch/tensor.cpp +4 -4
- data/ext/torch/utils.h +1 -1
- data/lib/torch/version.rb +1 -1
- metadata +4 -4
data/ext/torch/backends.cpp
CHANGED
@@ -14,4 +14,8 @@ void init_backends(Rice::Module& m) {
|
|
14
14
|
Rice::define_module_under(rb_mBackends, "MKL")
|
15
15
|
.add_handler<torch::Error>(handle_error)
|
16
16
|
.define_singleton_function("available?", &torch::hasMKL);
|
17
|
+
|
18
|
+
Rice::define_module_under(rb_mBackends, "MPS")
|
19
|
+
.add_handler<torch::Error>(handle_error)
|
20
|
+
.define_singleton_function("available?", &torch::hasMPS);
|
17
21
|
}
|
data/ext/torch/tensor.cpp
CHANGED
@@ -35,17 +35,17 @@ std::vector<TensorIndex> index_vector(Array a) {
|
|
35
35
|
if (obj.is_instance_of(rb_cInteger)) {
|
36
36
|
indices.push_back(Rice::detail::From_Ruby<int64_t>().convert(obj.value()));
|
37
37
|
} else if (obj.is_instance_of(rb_cRange)) {
|
38
|
-
torch::optional<
|
39
|
-
torch::optional<
|
38
|
+
torch::optional<c10::SymInt> start_index = torch::nullopt;
|
39
|
+
torch::optional<c10::SymInt> stop_index = torch::nullopt;
|
40
40
|
|
41
41
|
Object begin = obj.call("begin");
|
42
42
|
if (!begin.is_nil()) {
|
43
|
-
start_index = Rice::detail::From_Ruby<int64_t>().convert(begin.value());
|
43
|
+
start_index = c10::SymInt(Rice::detail::From_Ruby<int64_t>().convert(begin.value()));
|
44
44
|
}
|
45
45
|
|
46
46
|
Object end = obj.call("end");
|
47
47
|
if (!end.is_nil()) {
|
48
|
-
stop_index = Rice::detail::From_Ruby<int64_t>().convert(end.value());
|
48
|
+
stop_index = c10::SymInt(Rice::detail::From_Ruby<int64_t>().convert(end.value()));
|
49
49
|
}
|
50
50
|
|
51
51
|
Object exclude_end = obj.call("exclude_end?");
|
data/ext/torch/utils.h
CHANGED
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.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Kane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rice
|
@@ -230,14 +230,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
230
230
|
requirements:
|
231
231
|
- - ">="
|
232
232
|
- !ruby/object:Gem::Version
|
233
|
-
version: '
|
233
|
+
version: '3'
|
234
234
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
235
235
|
requirements:
|
236
236
|
- - ">="
|
237
237
|
- !ruby/object:Gem::Version
|
238
238
|
version: '0'
|
239
239
|
requirements: []
|
240
|
-
rubygems_version: 3.4.
|
240
|
+
rubygems_version: 3.4.10
|
241
241
|
signing_key:
|
242
242
|
specification_version: 4
|
243
243
|
summary: Deep learning for Ruby, powered by LibTorch
|