Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
171f8ec
Updated LibTorch to 1.7.0
ankane Oct 27, 2020
30d02fe
Added test for max change in 1.7.0 [skip ci]
ankane Oct 27, 2020
801d8c5
Merge branch 'master' into libtorch-1.7.0
ankane Oct 28, 2020
d348c93
Updated changelog [skip ci]
ankane Oct 28, 2020
47841b1
Removed deprecated overload for addcmul! and addcdiv!
ankane Oct 28, 2020
14b38d7
Updated readme [skip ci]
ankane Oct 28, 2020
fce162e
Merge pull request #1 from orlando-labs/edge
orlando-labs Dec 7, 2020
e86311f
Merge branch 'master' of https://github.com/ankane/torch.rb
Dec 17, 2020
80a601d
manual_seed and manual_seed_all CUDA methods added
Dec 17, 2020
0612de7
Unknown parameter in module error message fixed
Dec 17, 2020
5e117f0
fixed CUDA random test for non-CUDA environment
Dec 17, 2020
987a300
removed useless commented out header
Dec 17, 2020
4eb8d64
Merge branch 'master' of https://github.com/ankane/torch-rb
Dec 21, 2020
cecf398
named buffers load/save
Dec 21, 2020
b20770c
debug print removed
Dec 21, 2020
d536335
Merge branch 'master' of https://github.com/ankane/torch-rb
Jan 14, 2021
2c8c1c8
Merge branch 'ankane:master' into master
orlando-labs Jul 6, 2021
477f08b
Merge branch 'ankane:master' into master
orlando-labs Aug 3, 2021
ef05f10
multihead attention
Aug 4, 2021
d2edbab
removed endless range for respecting dying ruby 2.6
Aug 4, 2021
f9e9e86
module list
Aug 4, 2021
898b4dd
Transformer: attention is all you need
Aug 4, 2021
49ec070
Merge https://github.com/ankane/torch.rb
Aug 4, 2021
77c152e
Merge branch 'ankane:master' into master
orlando-labs Sep 30, 2021
512962c
attribute readers for ConvNd
orlando-labs Sep 30, 2021
8cfbd3b
Merge pull request #2 from orlando-labs/attr_readers_for_conv_nd
orlando-labs Sep 30, 2021
480baa8
Fixed generation of square subsequent mask
orlando-labs Sep 30, 2021
6038643
Merge pull request #3 from orlando-labs/fix_generate_square_subsequen…
orlando-labs Sep 30, 2021
c8a7575
Merge remote-tracking branch 'upstream/master'
Dec 16, 2021
8fe2e6d
Merge branch 'ankane:master' into master
orlando-labs May 2, 2023
fa988dc
Merge branch 'ankane:master' into master
orlando-labs May 3, 2023
85aa9c3
Merge branch 'ankane:master' into master
orlando-labs Aug 6, 2025
27ebffd
Merge branch 'ankane:master' into master
orlando-labs Nov 11, 2025
64be5d3
distributed data parallel port with the supporting features: Torch#lo…
Nov 14, 2025
20e7845
Updated distributed example
Nov 15, 2025
52282cb
inter-device map_location fixed
Nov 17, 2025
cac2534
autodetecting libtorch distributed support
Nov 17, 2025
d8dc295
DDP fixes and improvements
Nov 19, 2025
0286f2a
possible fix for non-cuda c10
Nov 19, 2025
4276d63
added missing const_cast
Nov 19, 2025
51785c9
skipping cuda tests when c10 for nccl in not available
Nov 19, 2025
e63f784
GLOO support
Nov 21, 2025
3ab737c
only multi-device core functionality remains
Dec 5, 2025
03f4682
distributed tests removed
Dec 5, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ As well as:
First, [download LibTorch](https://pytorch.org/get-started/locally/). For Mac arm64, use:

```sh
curl -L https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.9.0.zip > libtorch.zip
curl -L https://download.pytorch.org/libtorch/cpu/libtorch-macos-arm64-2.9.1.zip > libtorch.zip
unzip -q libtorch.zip
```

Expand All @@ -42,6 +42,8 @@ gem "torch-rb"

It can take 5-10 minutes to compile the extension. Windows is not currently supported.

For distributed data parallel helpers, add the optional `torch-ddp` gem alongside this one.

## Getting Started

A good place to start is [Deep Learning with Torch.rb: A 60 Minute Blitz](tutorials/blitz/README.md).
Expand Down Expand Up @@ -329,6 +331,8 @@ net.load_state_dict(Torch.load("net.pth"))
net.eval
```

`Torch.load` mirrors the Python API and accepts `map_location` and `weights_only` keyword arguments for compatibility with existing PyTorch checkpoints.

When saving a model in Python to load in Ruby, convert parameters to tensors (due to outstanding bugs in LibTorch)

```python
Expand Down
6 changes: 6 additions & 0 deletions bin/torchrun
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require_relative "../lib/torch/torchrun"

Torch::TorchRun.start(ARGV)
Loading