Skip to content

Commit

Permalink
Iter2: store my output on the same device as the first input
Browse files Browse the repository at this point in the history
In order for Iter2 to be usable with a GPU, you needed to do
Iter2::new(...).to_device(vs.device()).shuffle()

Now with this patch, the to_device is not necessary, which
is consistent with my expectations.

However, it has virtually no performance difference, positive
or negative.
  • Loading branch information
Charles Samuels committed Dec 22, 2022
1 parent 23db431 commit 908dcc2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
### Changed
- Create `Iter2`'s output on the same device as its first parameter.

## v0.10.1 - 2022-12-12
### Changed
- Default `vs.load` to use the Python weight format when the file extension is `.pt` or `.bin`.
Expand Down
2 changes: 1 addition & 1 deletion src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Iter2 {
batch_index: 0,
batch_size,
total_size,
device: Device::Cpu,
device: xs.device(),
return_smaller_last_batch: false,
})
}
Expand Down

0 comments on commit 908dcc2

Please sign in to comment.