torch-rb 0.26.0 → 0.27.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 +4 -0
- data/README.md +2 -2
- data/codegen/native_functions.yaml +73 -53
- data/ext/torch/utils.h +1 -1
- data/lib/torch/nn/module.rb +2 -2
- data/lib/torch/optim/lr_scheduler/multi_step_lr.rb +1 -1
- data/lib/torch/optim/optimizer.rb +2 -2
- data/lib/torch/version.rb +1 -1
- data/lib/torch.rb +2 -2
- 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: 640e66dad79610e8cbe3559f46edbb6673e60376dd12c52408e2c966bd8418c7
|
|
4
|
+
data.tar.gz: 7b4753cbd521f6724feeac18a2d908dc76394b890918d86e62ce92ef605155c5
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9bf90f990d386e240af32fb177571f4cd60a523ecf5e31b4c50d0a0634d812443309af7c3f2b5f17ce0e9e5b17724c4cb4e967b2a7e3a0a003ee0d2fde692218
|
|
7
|
+
data.tar.gz: 5962a968d8815a76999eee43a9ef6f8858e7cacb870484b5f762715c0fef9aa2dc06c5361b251559684e672f40ef8668639d37b8fe32eaa5194a93bf92d3bb83
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
|
@@ -23,7 +23,7 @@ As well as:
|
|
|
23
23
|
First, [download LibTorch](https://pytorch.org/get-started/locally/). For Mac arm64, use:
|
|
24
24
|
|
|
25
25
|
```sh
|
|
26
|
-
curl -L https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.
|
|
26
|
+
curl -L https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.15.0.zip > libtorch.zip
|
|
27
27
|
unzip -q libtorch.zip
|
|
28
28
|
```
|
|
29
29
|
|
|
@@ -419,12 +419,12 @@ Here’s the list of compatible versions.
|
|
|
419
419
|
|
|
420
420
|
Torch.rb | LibTorch
|
|
421
421
|
--- | ---
|
|
422
|
+
0.27.x | 2.15.x
|
|
422
423
|
0.26.x | 2.14.x
|
|
423
424
|
0.25.x | 2.13.x
|
|
424
425
|
0.24.x | 2.12.x
|
|
425
426
|
0.23.x | 2.10.x
|
|
426
427
|
0.22.x | 2.9.x
|
|
427
|
-
0.21.x | 2.8.x
|
|
428
428
|
|
|
429
429
|
## Performance
|
|
430
430
|
|
|
@@ -475,8 +475,7 @@
|
|
|
475
475
|
|
|
476
476
|
- func: conj_physical.out(Tensor self, *, Tensor(a!) out) -> Tensor(a!)
|
|
477
477
|
dispatch:
|
|
478
|
-
CPU, CUDA, XPU: conj_physical_out
|
|
479
|
-
MPS: conj_physical_out_mps
|
|
478
|
+
CPU, CUDA, XPU, MPS: conj_physical_out
|
|
480
479
|
SparseCPU, SparseCUDA, SparseMPS, SparseXPU: conj_physical_out_sparse
|
|
481
480
|
SparseCsrCPU, SparseCsrCUDA, SparseCsrMPS, SparseCsrMeta, SparseCsrXPU: conj_physical_sparse_csr_out
|
|
482
481
|
tags: pointwise
|
|
@@ -766,10 +765,12 @@
|
|
|
766
765
|
- func: arange(Scalar end, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
|
|
767
766
|
dispatch:
|
|
768
767
|
CompositeExplicitAutograd: arange
|
|
768
|
+
Meta: arange_meta
|
|
769
769
|
|
|
770
770
|
- func: arange.start(Scalar start, Scalar end, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
|
|
771
771
|
dispatch:
|
|
772
772
|
CompositeExplicitAutograd: arange
|
|
773
|
+
Meta: arange_meta
|
|
773
774
|
|
|
774
775
|
# This operator should be named `arange.start_out` if following the naming convention. However that
|
|
775
776
|
# name is already taken. Disabled because of CI job failures.
|
|
@@ -781,6 +782,7 @@
|
|
|
781
782
|
- func: arange.start_step(Scalar start, Scalar end, Scalar step=1, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
|
|
782
783
|
dispatch:
|
|
783
784
|
CompositeExplicitAutograd: arange
|
|
785
|
+
Meta: arange_meta
|
|
784
786
|
cpp_no_default_args: ['step']
|
|
785
787
|
tags: core
|
|
786
788
|
|
|
@@ -1293,8 +1295,7 @@
|
|
|
1293
1295
|
- func: logical_xor.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
|
|
1294
1296
|
device_check: NoCheck # TensorIterator
|
|
1295
1297
|
dispatch:
|
|
1296
|
-
CPU, CUDA, MTIA, XPU: logical_xor_out
|
|
1297
|
-
MPS: logical_xor_out_mps
|
|
1298
|
+
CPU, CUDA, MPS, MTIA, XPU: logical_xor_out
|
|
1298
1299
|
tags: pointwise
|
|
1299
1300
|
|
|
1300
1301
|
- func: logical_and(Tensor self, Tensor other) -> Tensor
|
|
@@ -1314,8 +1315,7 @@
|
|
|
1314
1315
|
- func: logical_and.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
|
|
1315
1316
|
device_check: NoCheck # TensorIterator
|
|
1316
1317
|
dispatch:
|
|
1317
|
-
CPU, CUDA, MTIA, XPU: logical_and_out
|
|
1318
|
-
MPS: logical_and_out_mps
|
|
1318
|
+
CPU, CUDA, MPS, MTIA, XPU: logical_and_out
|
|
1319
1319
|
tags: pointwise
|
|
1320
1320
|
|
|
1321
1321
|
- func: logical_or(Tensor self, Tensor other) -> Tensor
|
|
@@ -1335,8 +1335,7 @@
|
|
|
1335
1335
|
- func: logical_or.out(Tensor self, Tensor other, *, Tensor(a!) out) -> Tensor(a!)
|
|
1336
1336
|
device_check: NoCheck # TensorIterator
|
|
1337
1337
|
dispatch:
|
|
1338
|
-
CPU, CUDA, MTIA, XPU: logical_or_out
|
|
1339
|
-
MPS: logical_or_out_mps
|
|
1338
|
+
CPU, CUDA, MPS, MTIA, XPU: logical_or_out
|
|
1340
1339
|
tags: pointwise
|
|
1341
1340
|
|
|
1342
1341
|
- func: blackman_window(int window_length, *, ScalarType? dtype=None, Layout? layout=None, Device? device=None, bool? pin_memory=None) -> Tensor
|
|
@@ -3689,6 +3688,7 @@
|
|
|
3689
3688
|
dispatch:
|
|
3690
3689
|
CPU, Meta: logspace_out
|
|
3691
3690
|
CUDA: logspace_cuda_out
|
|
3691
|
+
MPS: logspace_out_mps
|
|
3692
3692
|
XPU: logspace_xpu_out
|
|
3693
3693
|
|
|
3694
3694
|
- func: logspace.Tensor_Tensor_out(Tensor start, Tensor end, int steps, float base=10.0, *, Tensor(a!) out) -> Tensor(a!)
|
|
@@ -4169,12 +4169,14 @@
|
|
|
4169
4169
|
dispatch:
|
|
4170
4170
|
CPU: _int_mm_cpu
|
|
4171
4171
|
CUDA: _int_mm_cuda
|
|
4172
|
+
MPS: _int_mm_mps
|
|
4172
4173
|
XPU: _int_mm_xpu
|
|
4173
4174
|
|
|
4174
4175
|
- func: _int_mm.out(Tensor self, Tensor mat2, *, Tensor(a!) out) -> Tensor(a!)
|
|
4175
4176
|
dispatch:
|
|
4176
4177
|
CPU: _int_mm_out_cpu
|
|
4177
4178
|
CUDA: _int_mm_out_cuda
|
|
4179
|
+
MPS: _int_mm_out_mps
|
|
4178
4180
|
XPU: _int_mm_out_xpu
|
|
4179
4181
|
|
|
4180
4182
|
- func: _convert_weight_to_int4pack(Tensor self, int innerKTiles) -> Tensor
|
|
@@ -5085,8 +5087,7 @@
|
|
|
5085
5087
|
device_check: NoCheck # TensorIterator
|
|
5086
5088
|
variants: function, method
|
|
5087
5089
|
dispatch:
|
|
5088
|
-
CPU, CUDA, XPU: relu
|
|
5089
|
-
MPS: relu_mps
|
|
5090
|
+
CPU, CUDA, MPS, XPU: relu
|
|
5090
5091
|
MTIA: relu_mtia
|
|
5091
5092
|
MkldnnCPU: mkldnn_relu
|
|
5092
5093
|
QuantizedCPU: relu_quantized_cpu
|
|
@@ -5100,8 +5101,7 @@
|
|
|
5100
5101
|
device_check: NoCheck # TensorIterator
|
|
5101
5102
|
variants: function, method
|
|
5102
5103
|
dispatch:
|
|
5103
|
-
CPU, CUDA, XPU: relu_
|
|
5104
|
-
MPS: relu_mps_
|
|
5104
|
+
CPU, CUDA, MPS, XPU: relu_
|
|
5105
5105
|
MTIA: relu_mtia_
|
|
5106
5106
|
MkldnnCPU: mkldnn_relu_
|
|
5107
5107
|
QuantizedCPU: relu_quantized_cpu_
|
|
@@ -5970,8 +5970,7 @@
|
|
|
5970
5970
|
device_check: NoCheck # TensorIterator
|
|
5971
5971
|
variants: function, method
|
|
5972
5972
|
dispatch:
|
|
5973
|
-
CPU, CUDA, XPU: prod
|
|
5974
|
-
MPS: prod_mps
|
|
5973
|
+
CPU, CUDA, MPS, XPU: prod
|
|
5975
5974
|
autogen: prod.out
|
|
5976
5975
|
tags: [core, reduction]
|
|
5977
5976
|
|
|
@@ -5985,8 +5984,7 @@
|
|
|
5985
5984
|
structured: True
|
|
5986
5985
|
device_check: NoCheck # TensorIterator
|
|
5987
5986
|
dispatch:
|
|
5988
|
-
CPU, CUDA, XPU: prod_out
|
|
5989
|
-
MPS: prod_out_mps
|
|
5987
|
+
CPU, CUDA, MPS, XPU: prod_out
|
|
5990
5988
|
tags: reduction
|
|
5991
5989
|
|
|
5992
5990
|
- func: t(Tensor(a) self) -> Tensor(a)
|
|
@@ -6154,8 +6152,7 @@
|
|
|
6154
6152
|
- func: flip(Tensor self, int[] dims) -> Tensor
|
|
6155
6153
|
variants: function, method
|
|
6156
6154
|
dispatch:
|
|
6157
|
-
CPU, QuantizedCPU, CUDA, QuantizedCUDA, XPU: flip
|
|
6158
|
-
MPS: flip_mps
|
|
6155
|
+
CPU, QuantizedCPU, CUDA, QuantizedCUDA, XPU, MPS: flip
|
|
6159
6156
|
autogen: flip.out
|
|
6160
6157
|
tags: core
|
|
6161
6158
|
|
|
@@ -6638,6 +6635,13 @@
|
|
|
6638
6635
|
CUDA: _philox_uniform_cuda_
|
|
6639
6636
|
autogen: _philox_uniform, _philox_uniform.out
|
|
6640
6637
|
|
|
6638
|
+
- func: _philox_randint_(Tensor(a!) self, Tensor key, int? low=None, int? high=None) -> Tensor(a!)
|
|
6639
|
+
variants: function, method
|
|
6640
|
+
dispatch:
|
|
6641
|
+
CPU: _philox_randint_cpu_
|
|
6642
|
+
CUDA: _philox_randint_cuda_
|
|
6643
|
+
autogen: _philox_randint, _philox_randint.out
|
|
6644
|
+
|
|
6641
6645
|
- func: _dirichlet_grad(Tensor x, Tensor alpha, Tensor total) -> Tensor
|
|
6642
6646
|
dispatch:
|
|
6643
6647
|
CPU: _dirichlet_grad_cpu
|
|
@@ -6855,7 +6859,7 @@
|
|
|
6855
6859
|
|
|
6856
6860
|
- func: frexp.Tensor_out(Tensor self, *, Tensor(a!) mantissa, Tensor(b!) exponent) -> (Tensor(a!) mantissa, Tensor(b!) exponent)
|
|
6857
6861
|
dispatch:
|
|
6858
|
-
CPU, CUDA, XPU: frexp_out
|
|
6862
|
+
CPU, CUDA, MPS, XPU: frexp_out
|
|
6859
6863
|
tags: pointwise
|
|
6860
6864
|
|
|
6861
6865
|
# Deprecated (v.1.12)
|
|
@@ -6918,7 +6922,8 @@
|
|
|
6918
6922
|
device_check: NoCheck # TensorIterator
|
|
6919
6923
|
variants: method, function
|
|
6920
6924
|
dispatch:
|
|
6921
|
-
CPU,
|
|
6925
|
+
CPU, MPS, XPU: zero_
|
|
6926
|
+
CUDA: zero_cuda_
|
|
6922
6927
|
Meta: zero_meta_
|
|
6923
6928
|
SparseCPU, SparseCUDA, SparseMPS, SparseMeta, SparseXPU: zero_sparse_
|
|
6924
6929
|
SparseCsrCPU, SparseCsrCUDA, SparseCsrMeta, SparseCsrXPU: zero_sparse_csr_
|
|
@@ -6931,8 +6936,7 @@
|
|
|
6931
6936
|
structured: True
|
|
6932
6937
|
structured_inherits: TensorIteratorBase
|
|
6933
6938
|
dispatch:
|
|
6934
|
-
CPU, CUDA, XPU: sub_out
|
|
6935
|
-
MPS: sub_out_mps
|
|
6939
|
+
CPU, CUDA, MPS, XPU: sub_out
|
|
6936
6940
|
MTIA: sub_out_mtia
|
|
6937
6941
|
SparseCPU, SparseCUDA, SparseMPS, SparseXPU: sub_out_sparse
|
|
6938
6942
|
tags: pointwise
|
|
@@ -6999,7 +7003,7 @@
|
|
|
6999
7003
|
structured_inherits: TensorIteratorBase
|
|
7000
7004
|
device_check: NoCheck # TensorIterator
|
|
7001
7005
|
dispatch:
|
|
7002
|
-
CPU, CUDA, XPU: heaviside_out
|
|
7006
|
+
CPU, CUDA, MPS, XPU: heaviside_out
|
|
7003
7007
|
tags: pointwise
|
|
7004
7008
|
|
|
7005
7009
|
- func: heaviside(Tensor self, Tensor values) -> Tensor
|
|
@@ -7131,7 +7135,6 @@
|
|
|
7131
7135
|
- func: _scaled_mm_v2(Tensor self, Tensor mat2, Tensor[] scale_a, int[] recipe_a, int[] swizzle_a, Tensor[] scale_b, int[] recipe_b, int[] swizzle_b, Tensor? bias, ScalarType? out_dtype, int[] contraction_dim=[], bool use_fast_accum=False) -> Tensor
|
|
7132
7136
|
structured_delegate: _scaled_mm_v2.out
|
|
7133
7137
|
variants: function
|
|
7134
|
-
tags: needs_exact_strides
|
|
7135
7138
|
|
|
7136
7139
|
- func: _scaled_mm_v2.out(Tensor self, Tensor mat2, Tensor[] scale_a, int[] recipe_a, int[] swizzle_a, Tensor[] scale_b, int[] recipe_b, int[] swizzle_b, Tensor? bias, ScalarType? out_dtype, int[] contraction_dim=[], bool use_fast_accum=False, *, Tensor(a!) out) -> Tensor(a!)
|
|
7137
7140
|
structured: True
|
|
@@ -7139,7 +7142,24 @@
|
|
|
7139
7142
|
dispatch:
|
|
7140
7143
|
CPU: _scaled_mm_cpu_v2_out
|
|
7141
7144
|
CUDA: _scaled_mm_cuda_v2_out
|
|
7145
|
+
MPS: _scaled_mm_mps_v2_out
|
|
7142
7146
|
XPU: _scaled_mm_xpu_v2_out
|
|
7147
|
+
|
|
7148
|
+
- func: _scaled_addmm(Tensor self, Tensor mat1, Tensor mat2, Tensor[] scale_a, int[] recipe_a, int[] swizzle_a, Tensor[] scale_b, int[] recipe_b, int[] swizzle_b, int[] contraction_dim=[], *, Scalar beta=1, Scalar alpha=1, bool use_fast_accum=False) -> Tensor
|
|
7149
|
+
structured_delegate: _scaled_addmm.out
|
|
7150
|
+
variants: function
|
|
7151
|
+
tags: needs_exact_strides
|
|
7152
|
+
|
|
7153
|
+
- func: _scaled_addmm_(Tensor(a!) self, Tensor mat1, Tensor mat2, Tensor[] scale_a, int[] recipe_a, int[] swizzle_a, Tensor[] scale_b, int[] recipe_b, int[] swizzle_b, int[] contraction_dim=[], *, Scalar beta=1, Scalar alpha=1, bool use_fast_accum=False) -> Tensor(a!)
|
|
7154
|
+
structured_delegate: _scaled_addmm.out
|
|
7155
|
+
variants: function
|
|
7156
|
+
tags: needs_exact_strides
|
|
7157
|
+
|
|
7158
|
+
- func: _scaled_addmm.out(Tensor self, Tensor mat1, Tensor mat2, Tensor[] scale_a, int[] recipe_a, int[] swizzle_a, Tensor[] scale_b, int[] recipe_b, int[] swizzle_b, int[] contraction_dim=[], *, Scalar beta=1, Scalar alpha=1, bool use_fast_accum=False, Tensor(a!) out) -> Tensor(a!)
|
|
7159
|
+
structured: True
|
|
7160
|
+
variants: function
|
|
7161
|
+
dispatch:
|
|
7162
|
+
CUDA: _scaled_addmm_cuda_out
|
|
7143
7163
|
tags: needs_exact_strides
|
|
7144
7164
|
|
|
7145
7165
|
- func: _scaled_grouped_mm(Tensor self, Tensor mat2, Tensor scale_a, Tensor scale_b, Tensor? offs=None, Tensor? bias=None, Tensor? scale_result=None, ScalarType? out_dtype=None, bool use_fast_accum=False) -> Tensor
|
|
@@ -7165,6 +7185,7 @@
|
|
|
7165
7185
|
dispatch:
|
|
7166
7186
|
CompositeExplicitAutograd: _grouped_mm
|
|
7167
7187
|
CUDA: _grouped_mm_cuda
|
|
7188
|
+
MPS: _grouped_mm_mps
|
|
7168
7189
|
|
|
7169
7190
|
# NOTE [ Sparse: autograd and API ]
|
|
7170
7191
|
#
|
|
@@ -8207,7 +8228,7 @@
|
|
|
8207
8228
|
- func: put_(Tensor(a!) self, Tensor index, Tensor source, bool accumulate=False) -> Tensor(a!)
|
|
8208
8229
|
variants: method
|
|
8209
8230
|
dispatch:
|
|
8210
|
-
CPU, CUDA, XPU: put_
|
|
8231
|
+
CPU, CUDA, MPS, XPU: put_
|
|
8211
8232
|
autogen: put.out
|
|
8212
8233
|
|
|
8213
8234
|
- func: put(Tensor self, Tensor index, Tensor source, bool accumulate=False) -> Tensor
|
|
@@ -9259,12 +9280,12 @@
|
|
|
9259
9280
|
|
|
9260
9281
|
- func: take.out(Tensor self, Tensor index, *, Tensor(a!) out) -> Tensor(a!)
|
|
9261
9282
|
dispatch:
|
|
9262
|
-
CPU, CUDA, XPU: take_out
|
|
9283
|
+
CPU, CUDA, MPS, XPU: take_out
|
|
9263
9284
|
|
|
9264
9285
|
- func: take(Tensor self, Tensor index) -> Tensor
|
|
9265
9286
|
variants: method, function
|
|
9266
9287
|
dispatch:
|
|
9267
|
-
CPU, CUDA, XPU: take
|
|
9288
|
+
CPU, CUDA, MPS, XPU: take
|
|
9268
9289
|
|
|
9269
9290
|
- func: take_along_dim.out(Tensor self, Tensor indices, int? dim=None, *, Tensor(a!) out) -> Tensor(a!)
|
|
9270
9291
|
|
|
@@ -9383,8 +9404,7 @@
|
|
|
9383
9404
|
structured_inherits: TensorIteratorBase
|
|
9384
9405
|
device_check: NoCheck # TensorIterator
|
|
9385
9406
|
dispatch:
|
|
9386
|
-
CPU, CUDA, MTIA, XPU: addcmul_out
|
|
9387
|
-
MPS: addcmul_out_mps
|
|
9407
|
+
CPU, CUDA, MPS, MTIA, XPU: addcmul_out
|
|
9388
9408
|
tags: pointwise
|
|
9389
9409
|
|
|
9390
9410
|
- func: addcmul(Tensor self, Tensor tensor1, Tensor tensor2, *, Scalar value=1) -> Tensor
|
|
@@ -9404,8 +9424,7 @@
|
|
|
9404
9424
|
structured_inherits: TensorIteratorBase
|
|
9405
9425
|
device_check: NoCheck # TensorIterator
|
|
9406
9426
|
dispatch:
|
|
9407
|
-
CPU, CUDA, MTIA, XPU: addcdiv_out
|
|
9408
|
-
MPS: addcdiv_out_mps
|
|
9427
|
+
CPU, CUDA, MPS, MTIA, XPU: addcdiv_out
|
|
9409
9428
|
tags: pointwise
|
|
9410
9429
|
|
|
9411
9430
|
- func: addcdiv(Tensor self, Tensor tensor1, Tensor tensor2, *, Scalar value=1) -> Tensor
|
|
@@ -9517,12 +9536,12 @@
|
|
|
9517
9536
|
|
|
9518
9537
|
- func: geqrf.a(Tensor self, *, Tensor(a!) a, Tensor(b!) tau) -> (Tensor(a!) a, Tensor(b!) tau)
|
|
9519
9538
|
dispatch:
|
|
9520
|
-
CPU, CUDA, MPS: geqrf_out
|
|
9539
|
+
CPU, CUDA, MPS, XPU: geqrf_out
|
|
9521
9540
|
|
|
9522
9541
|
- func: geqrf(Tensor self) -> (Tensor a, Tensor tau)
|
|
9523
9542
|
variants: method, function
|
|
9524
9543
|
dispatch:
|
|
9525
|
-
CPU, CUDA, MPS: geqrf
|
|
9544
|
+
CPU, CUDA, MPS, XPU: geqrf
|
|
9526
9545
|
|
|
9527
9546
|
# orgqr, alias for linalg_householder_product
|
|
9528
9547
|
- func: orgqr(Tensor self, Tensor input2) -> Tensor
|
|
@@ -10251,8 +10270,7 @@
|
|
|
10251
10270
|
structured: True
|
|
10252
10271
|
structured_inherits: TensorIteratorBase
|
|
10253
10272
|
dispatch:
|
|
10254
|
-
CPU, CUDA, XPU: pow_Tensor_Tensor_out
|
|
10255
|
-
MPS: pow_tensor_tensor_out_mps
|
|
10273
|
+
CPU, CUDA, MPS, XPU: pow_Tensor_Tensor_out
|
|
10256
10274
|
tags: pointwise
|
|
10257
10275
|
|
|
10258
10276
|
- func: pow.Tensor_Tensor(Tensor self, Tensor exponent) -> Tensor
|
|
@@ -11245,7 +11263,6 @@
|
|
|
11245
11263
|
CompositeExplicitAutograd: foreach_tensor_ternary_lerp_slow
|
|
11246
11264
|
CUDA: foreach_tensor_lerp_ternary_cuda
|
|
11247
11265
|
XPU: foreach_tensor_lerp_ternary_xpu
|
|
11248
|
-
autogen: _foreach_lerp.List_out
|
|
11249
11266
|
|
|
11250
11267
|
- func: _foreach_lerp_.List(Tensor(a!)[] self, Tensor[] tensors1, Tensor[] weights) -> ()
|
|
11251
11268
|
device_check: NoCheck # foreach kernels fall back to slow path when tensors are on different devices
|
|
@@ -11263,7 +11280,6 @@
|
|
|
11263
11280
|
CompositeExplicitAutograd: foreach_tensor_lerp_list_kernel_slow
|
|
11264
11281
|
CUDA: foreach_tensor_lerp_list_cuda
|
|
11265
11282
|
XPU: foreach_tensor_lerp_list_xpu
|
|
11266
|
-
autogen: _foreach_lerp.Scalar_out
|
|
11267
11283
|
|
|
11268
11284
|
- func: _foreach_lerp_.Scalar(Tensor(a!)[] self, Tensor[] tensors1, Scalar weight) -> ()
|
|
11269
11285
|
device_check: NoCheck # foreach kernels fall back to slow path when tensors are on different devices
|
|
@@ -11281,7 +11297,6 @@
|
|
|
11281
11297
|
CompositeExplicitAutograd: foreach_tensor_lerp_scalarlist_kernel_slow
|
|
11282
11298
|
CUDA: foreach_tensor_lerp_scalarlist_cuda
|
|
11283
11299
|
XPU: foreach_tensor_lerp_scalarlist_xpu
|
|
11284
|
-
autogen: _foreach_lerp.ScalarList_out
|
|
11285
11300
|
|
|
11286
11301
|
- func: _foreach_lerp_.ScalarList(Tensor(a!)[] self, Tensor[] tensors1, Scalar[] weight) -> ()
|
|
11287
11302
|
device_check: NoCheck # foreach kernels fall back to slow path when tensors are on different devices
|
|
@@ -11420,6 +11435,7 @@
|
|
|
11420
11435
|
dispatch:
|
|
11421
11436
|
CompositeExplicitAutograd: foreach_tensor_powsum_slow
|
|
11422
11437
|
CUDA: foreach_tensor_powsum_cuda
|
|
11438
|
+
XPU: foreach_tensor_powsum_xpu
|
|
11423
11439
|
autogen: _foreach_powsum.Scalar_out
|
|
11424
11440
|
|
|
11425
11441
|
- func: _foreach_pow.List(Tensor[] self, Tensor[] exponent) -> Tensor[]
|
|
@@ -12300,8 +12316,7 @@
|
|
|
12300
12316
|
device_check: NoCheck # TensorIterator
|
|
12301
12317
|
python_module: nn
|
|
12302
12318
|
dispatch:
|
|
12303
|
-
CPU, CUDA, XPU: softplus_out
|
|
12304
|
-
MPS: softplus_out_mps
|
|
12319
|
+
CPU, CUDA, MPS, XPU: softplus_out
|
|
12305
12320
|
|
|
12306
12321
|
- func: softplus(Tensor self, Scalar beta=1, Scalar threshold=20) -> Tensor
|
|
12307
12322
|
structured_delegate: softplus.out
|
|
@@ -12314,8 +12329,7 @@
|
|
|
12314
12329
|
structured_inherits: TensorIteratorBase
|
|
12315
12330
|
python_module: nn
|
|
12316
12331
|
dispatch:
|
|
12317
|
-
CPU, CUDA, XPU: softplus_backward_out
|
|
12318
|
-
MPS: softplus_backward_out_mps
|
|
12332
|
+
CPU, CUDA, MPS, XPU: softplus_backward_out
|
|
12319
12333
|
|
|
12320
12334
|
- func: softplus_backward(Tensor grad_output, Tensor self, Scalar beta, Scalar threshold) -> Tensor
|
|
12321
12335
|
structured_delegate: softplus_backward.grad_input
|
|
@@ -13318,8 +13332,7 @@
|
|
|
13318
13332
|
structured: True
|
|
13319
13333
|
structured_inherits: TensorIteratorBase
|
|
13320
13334
|
dispatch:
|
|
13321
|
-
CPU, CUDA, XPU: logit_backward_out
|
|
13322
|
-
MPS: logit_backward_out_mps
|
|
13335
|
+
CPU, CUDA, MPS, XPU: logit_backward_out
|
|
13323
13336
|
tags: pointwise
|
|
13324
13337
|
|
|
13325
13338
|
- func: logit_backward(Tensor grad_output, Tensor self, float? eps=None) -> Tensor
|
|
@@ -13332,8 +13345,7 @@
|
|
|
13332
13345
|
structured: True
|
|
13333
13346
|
structured_inherits: TensorIteratorBase
|
|
13334
13347
|
dispatch:
|
|
13335
|
-
CPU, CUDA, MTIA, XPU: tanh_backward_out
|
|
13336
|
-
MPS: tanh_backward_out_mps
|
|
13348
|
+
CPU, CUDA, MPS, MTIA, XPU: tanh_backward_out
|
|
13337
13349
|
tags: pointwise
|
|
13338
13350
|
|
|
13339
13351
|
- func: tanh_backward(Tensor grad_output, Tensor output) -> Tensor
|
|
@@ -13519,6 +13531,7 @@
|
|
|
13519
13531
|
variants: method
|
|
13520
13532
|
dispatch:
|
|
13521
13533
|
CUDA: record_stream_cuda
|
|
13534
|
+
MPS: record_stream_mps
|
|
13522
13535
|
XPU: record_stream_xpu
|
|
13523
13536
|
|
|
13524
13537
|
- func: isposinf(Tensor self) -> Tensor
|
|
@@ -14485,12 +14498,12 @@
|
|
|
14485
14498
|
python_module: linalg
|
|
14486
14499
|
variants: function
|
|
14487
14500
|
dispatch:
|
|
14488
|
-
CPU, CUDA, MPS: linalg_householder_product
|
|
14501
|
+
CPU, CUDA, MPS, XPU: linalg_householder_product
|
|
14489
14502
|
|
|
14490
14503
|
- func: linalg_householder_product.out(Tensor input, Tensor tau, *, Tensor(a!) out) -> Tensor(a!)
|
|
14491
14504
|
python_module: linalg
|
|
14492
14505
|
dispatch:
|
|
14493
|
-
CPU, CUDA, MPS: linalg_householder_product_out
|
|
14506
|
+
CPU, CUDA, MPS, XPU: linalg_householder_product_out
|
|
14494
14507
|
|
|
14495
14508
|
- func: linalg_inv_ex(Tensor A, *, bool check_errors=False) -> (Tensor inverse, Tensor info)
|
|
14496
14509
|
python_module: linalg
|
|
@@ -14551,7 +14564,7 @@
|
|
|
14551
14564
|
variants: function
|
|
14552
14565
|
structured_delegate: linalg_vector_norm.out
|
|
14553
14566
|
dispatch:
|
|
14554
|
-
SparseCPU, SparseCUDA, SparseMPS: linalg_vector_norm_sparse
|
|
14567
|
+
SparseCPU, SparseCUDA, SparseMPS, SparseXPU: linalg_vector_norm_sparse
|
|
14555
14568
|
tags: reduction
|
|
14556
14569
|
|
|
14557
14570
|
- func: linalg_vector_norm.out(Tensor self, Scalar ord=2, int[1]? dim=None, bool keepdim=False, *, ScalarType? dtype=None, Tensor(a!) out) -> Tensor(a!)
|
|
@@ -14569,7 +14582,7 @@
|
|
|
14569
14582
|
variants: function
|
|
14570
14583
|
dispatch:
|
|
14571
14584
|
CompositeExplicitAutograd: linalg__powsum_slow
|
|
14572
|
-
CPU, CUDA: linalg__powsum
|
|
14585
|
+
CPU, CUDA, XPU: linalg__powsum
|
|
14573
14586
|
tags: reduction
|
|
14574
14587
|
|
|
14575
14588
|
- func: linalg_matrix_norm(Tensor self, Scalar ord, int[] dim=[-2,-1], bool keepdim=False, *, ScalarType? dtype=None) -> Tensor
|
|
@@ -14689,6 +14702,7 @@
|
|
|
14689
14702
|
python_module: sparse
|
|
14690
14703
|
dispatch:
|
|
14691
14704
|
SparseCsrCUDA: _sparse_csr_linear_solve
|
|
14705
|
+
SparseCsrXPU: _sparse_csr_linear_solve_xpu
|
|
14692
14706
|
|
|
14693
14707
|
- func: linalg_solve.out(Tensor A, Tensor B, *, bool left=True, Tensor(a!) out) -> Tensor(a!)
|
|
14694
14708
|
python_module: linalg
|
|
@@ -14718,7 +14732,7 @@
|
|
|
14718
14732
|
python_module: linalg
|
|
14719
14733
|
structured: True
|
|
14720
14734
|
dispatch:
|
|
14721
|
-
CPU, CUDA, MPS: linalg_qr_out
|
|
14735
|
+
CPU, CUDA, MPS, XPU: linalg_qr_out
|
|
14722
14736
|
|
|
14723
14737
|
- func: linalg_polar(Tensor A) -> (Tensor U, Tensor H)
|
|
14724
14738
|
python_module: linalg
|
|
@@ -14729,7 +14743,7 @@
|
|
|
14729
14743
|
python_module: linalg
|
|
14730
14744
|
structured: True
|
|
14731
14745
|
dispatch:
|
|
14732
|
-
CPU, CUDA, MPS: linalg_polar_out
|
|
14746
|
+
CPU, CUDA, MPS, XPU: linalg_polar_out
|
|
14733
14747
|
|
|
14734
14748
|
- func: linalg_matrix_power(Tensor self, int n) -> Tensor
|
|
14735
14749
|
python_module: linalg
|
|
@@ -15352,6 +15366,12 @@
|
|
|
15352
15366
|
CUDA: _cudnn_attention_forward
|
|
15353
15367
|
tags: nondeterministic_seeded
|
|
15354
15368
|
|
|
15369
|
+
- func: _cudnn_attention_forward_no_dropout_inplace(Tensor(a!) out, Tensor query, Tensor key, Tensor value, Tensor cum_seq_q, Tensor? cum_seq_k, SymInt max_q, SymInt max_k, bool is_causal=False, *, float? scale=None, Tensor? seqused_k=None, Tensor? block_table=None) -> Tensor logsumexp
|
|
15370
|
+
variants: function
|
|
15371
|
+
dispatch:
|
|
15372
|
+
CUDA: _cudnn_attention_forward_no_dropout_inplace
|
|
15373
|
+
tags: nondeterministic_seeded
|
|
15374
|
+
|
|
15355
15375
|
- func: _cudnn_attention_backward(Tensor grad_out, Tensor query, Tensor key, Tensor value, Tensor out, Tensor logsumexp, Tensor philox_seed, Tensor philox_offset, Tensor attn_bias, Tensor cum_seq_q, Tensor cum_seq_k, SymInt max_q, SymInt max_k, float dropout_p, bool is_causal, *, float? scale=None) -> (Tensor, Tensor, Tensor)
|
|
15356
15376
|
dispatch:
|
|
15357
15377
|
CUDA: _cudnn_attention_backward
|
|
@@ -15771,7 +15791,7 @@
|
|
|
15771
15791
|
- func: special_laguerre_polynomial_l.out(Tensor x, Tensor n, *, Tensor(a!) out) -> Tensor(a!)
|
|
15772
15792
|
device_check: NoCheck
|
|
15773
15793
|
dispatch:
|
|
15774
|
-
CPU, CUDA, XPU: special_laguerre_polynomial_l_out
|
|
15794
|
+
CPU, CUDA, MPS, XPU: special_laguerre_polynomial_l_out
|
|
15775
15795
|
python_module: special
|
|
15776
15796
|
structured_inherits: TensorIteratorBase
|
|
15777
15797
|
structured: True
|
data/ext/torch/utils.h
CHANGED
data/lib/torch/nn/module.rb
CHANGED
|
@@ -337,7 +337,7 @@ module Torch
|
|
|
337
337
|
if vars.any?
|
|
338
338
|
vars.map(&:inspect)
|
|
339
339
|
else
|
|
340
|
-
options.
|
|
340
|
+
options.to_h { |k, v| [k, v.inspect] }
|
|
341
341
|
end
|
|
342
342
|
str % vars
|
|
343
343
|
end
|
|
@@ -346,7 +346,7 @@ module Torch
|
|
|
346
346
|
# remove tensors for performance
|
|
347
347
|
# so we can skip call to inspect
|
|
348
348
|
def dict
|
|
349
|
-
instance_variables.reject { |k| instance_variable_get(k).is_a?(Tensor) }.
|
|
349
|
+
instance_variables.reject { |k| instance_variable_get(k).is_a?(Tensor) }.to_h { |k| [k[1..-1].to_sym, instance_variable_get(k)] }
|
|
350
350
|
end
|
|
351
351
|
|
|
352
352
|
def load_from_state_dict(state_dict, prefix, local_metadata, strict, missing_keys, unexpected_keys, error_msgs)
|
|
@@ -3,7 +3,7 @@ module Torch
|
|
|
3
3
|
module LRScheduler
|
|
4
4
|
class MultiStepLR < LRScheduler
|
|
5
5
|
def initialize(optimizer, milestones, gamma: 0.1, last_epoch: -1)
|
|
6
|
-
@milestones = milestones.map.with_index.
|
|
6
|
+
@milestones = milestones.map.with_index.to_h { |v, i| [v, i + 1] }
|
|
7
7
|
@gamma = gamma
|
|
8
8
|
super(optimizer, last_epoch)
|
|
9
9
|
end
|
|
@@ -35,13 +35,13 @@ module Torch
|
|
|
35
35
|
raise NotImplementedYet
|
|
36
36
|
|
|
37
37
|
pack_group = lambda do |group|
|
|
38
|
-
packed = group.select { |k, _| k != :params }.
|
|
38
|
+
packed = group.select { |k, _| k != :params }.to_h { |k, v| [k.to_s, v] }
|
|
39
39
|
packed["params"] = group[:params].map { |p| p.object_id }
|
|
40
40
|
packed
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
param_groups = @param_groups.map { |g| pack_group.call(g) }
|
|
44
|
-
packed_state = @state.
|
|
44
|
+
packed_state = @state.to_h { |k, v| [k.is_a?(Tensor) ? k.object_id : k, v] }
|
|
45
45
|
|
|
46
46
|
{
|
|
47
47
|
"state" => packed_state,
|
data/lib/torch/version.rb
CHANGED
data/lib/torch.rb
CHANGED
|
@@ -272,7 +272,7 @@ module Torch
|
|
|
272
272
|
qint32: 14,
|
|
273
273
|
bfloat16: 15
|
|
274
274
|
}
|
|
275
|
-
ENUM_TO_DTYPE = DTYPE_TO_ENUM.
|
|
275
|
+
ENUM_TO_DTYPE = DTYPE_TO_ENUM.invert
|
|
276
276
|
|
|
277
277
|
TENSOR_TYPE_CLASSES = []
|
|
278
278
|
|
|
@@ -408,7 +408,7 @@ module Torch
|
|
|
408
408
|
|
|
409
409
|
def tensor(data, **options)
|
|
410
410
|
if options[:dtype].nil? && defined?(Numo::NArray) && data.is_a?(Numo::NArray)
|
|
411
|
-
numo_to_dtype = _dtype_to_numo.
|
|
411
|
+
numo_to_dtype = _dtype_to_numo.invert
|
|
412
412
|
options[:dtype] = numo_to_dtype[data.class]
|
|
413
413
|
end
|
|
414
414
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: torch-rb
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.27.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Andrew Kane
|
|
@@ -241,7 +241,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
241
241
|
- !ruby/object:Gem::Version
|
|
242
242
|
version: '0'
|
|
243
243
|
requirements: []
|
|
244
|
-
rubygems_version: 4.0.
|
|
244
|
+
rubygems_version: 4.0.20
|
|
245
245
|
specification_version: 4
|
|
246
246
|
summary: Deep learning for Ruby, powered by LibTorch
|
|
247
247
|
test_files: []
|